You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throw is a reserved word and in ES3, reserved words were not allowed as the right operand in a member access. Fortunately, you can access arbitrarily-named members of an object by giving the indexing operator a string. The compilations are functionally identical.
For those interested in the technical details behind this:
In the ECMAScript spec (section 7.6 of ES5; the end of 5.1.5 in ES3), an Identifier is defined as an IdentifierName that is not in the set of reserved words. ES5 section 11.2.1 states that the dot in a member access is followed by an IdentifierName. ES3 section 11.2.1 erroneously stated that it is followed by an Identifier, disallowing reserved words as the right operand of the member access operator.
I'm having trouble testing an error message with mocha, should and coffeescript.
Why is the following statement compiled the way it is?
compiles into
I thought it should be
The text was updated successfully, but these errors were encountered: