Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error js compress #41

Closed
kamchatkin opened this issue Feb 18, 2013 · 1 comment
Closed

Error js compress #41

kamchatkin opened this issue Feb 18, 2013 · 1 comment

Comments

@kamchatkin
Copy link

Error js compress when hash object has name property as type data.
Example:

hash = {
int: true
}

funny, but even on the types of data that are not in javascript

hash = {
long: true
}

@tml
Copy link
Contributor

tml commented Feb 18, 2013

This is because 'long', 'int' and many others are considered to be of the class "FutureReservedWord" in ES3 (see section 7.5.3 of ECMA-262 3rd edition, found at http://www.ecma-international.org/publications/standards/Ecma-262-arch.htm), and "MemberExpression" must be "Identifiers" (i.e., IdentifierName but not ReservedWord).

I am working on a patchset that will move us to Rhino 1.7R3, which provides ES5 support, where some of these restrictions have been eased.

In the interim, you can resolve this by quoting these identifiers.

hash = {
"long": true
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants