In ES5, there were two changes. As you said, they removed some items from
the list of reserved words. Also, all reserved words are now allowed to be
used for certain names. As I recall, this includes names of members, but
not names of local variables. If enum is still considered reserved in ES,
then it probably can't be used as a function parameter, but it can be used
as a member variable or function name.

- Josh

On May 24, 2017 12:53 AM, "Olaf Krueger" <p...@olafkrueger.net> wrote:

Josh Tynjala wrote
>  As I mentioned in my previous post, JavaScript started
> allowing reserved words in places where they couldn't be used before with
> ES5. Since AS3 is derived from ECMAScript, it's pretty safe for us to do

Hi Josh,
maybe I get something wrong once again or I miss something but for me, it
seems that 'enum' is defined as a reserved keyword since ECMAScript1 and
until ECMAScript6.
As you mentioned in ES5 a lot of these keywords were removed, but 'enum' is
still there.
This is a nice overview of reserved words and different ES versions [1]

If you agree to teach the compiler that 'enum' should be recognised as
reserved keyword I'd file a JIRA.
And maybe I could assign this JIRA to myself if the solution is not o
complicated.
How could this be achieved? I found this which seems to me as a proper place
to just add as3ReservedWords.add("enum"); [2]

Thanks,
Olaf

[1] https://mathiasbynens.be/notes/reserved-keywords
[1]
https://github.com/apache/flex-falcon/blob/7137de6b19cd11630
ee1ef29f7a9164166e35b10/flex-compiler-oem/src/main/java/
flex2/compiler/mxml/lang/StandardDefs.java#L623






--
View this message in context: http://apache-flex-development
.2333347.n4.nabble.com/FlexJS-Compiler-doesn-t-recognize-
reserved-JS-words-like-enum-tp61735p61832.html
Sent from the Apache Flex Development mailing list archive at Nabble.com.

Reply via email to