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

Put old ES3 reserved words behind a flag #93

Closed
pwnall opened this issue Nov 1, 2012 · 4 comments
Closed

Put old ES3 reserved words behind a flag #93

pwnall opened this issue Nov 1, 2012 · 4 comments

Comments

@pwnall
Copy link

pwnall commented Nov 1, 2012

Rhino currently chokes on this code that contains an ES3 reserved word.

options.long

Java keywords that aren't used in JavaScript are not reserved anymore, as of ES5:
http://ecma-international.org/ecma-262/5.1/#sec-7.6.1
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words

For this reason, I think that the JS tokenizer should only choke on ES3 reserved words when a flag is set. (or, even better, not at all)

The relevant code seems to be here:
https://github.com/mozilla/rhino/blob/master/src/org/mozilla/javascript/TokenStream.java#L135

Once that is fixed, the map below should probably be re-generated.
https://github.com/mozilla/rhino/blob/master/src/org/mozilla/javascript/TokenStream.java#L153

@harking
Copy link

harking commented Dec 14, 2012

This is also needed so Rhino does not die when running QUnit tests that use throws() test.

@krumpi
Copy link

krumpi commented Dec 17, 2012

It also make it impossible to do Ember.js precompilation in Rhino. Ember uses the volatile keyword which is ES3
See
emberjs/ember.js#957
emberjs/ember.js#1202

@Fordi
Copy link

Fordi commented Mar 13, 2013

This is a problem; it makes it impossible to unit test Ember applications using EnvJasmine.

@p-bakker
Copy link
Collaborator

Closing as this works now in Rhino, at least with Context.VERSION_ES6 as language level:

var obj = {};
obj.volatile = 123;
obj.long = 456

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

5 participants