Error js compress #41

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

Comments

Projects
None yet
2 participants

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
}

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
}

tml closed this Feb 18, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment