Improve handling of future reserved words

RESOLVED FIXED

Status

Rhino
Core
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: Hannes Wallnoefer, Unassigned)

Tracking

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

9 years ago
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; de; rv:1.9.0.3) Gecko/2008092510 Ubuntu/8.04 (hardy) Firefox/3.0.3
Build Identifier: 

Rhino currently defaults to disallow future reserved words (ECMAScript 7.5.3) as identifiers. It seems all browser JS engines including spidermonkey allow these words to be used. Rhino has a FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER which is false by default, and prints a warning message when this feature is set to true and a future reserved word is encountered.

I propose to set the default value for FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER to true and remove the warning.

Reproducible: Always
(Reporter)

Comment 1

9 years ago
Created attachment 344257 [details] [diff] [review]
Fix for this bug

Sets the default value for Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER to true. Also treat "export" and "import" as ordinary reserved words instead of actual keywords. They are listed as such in the ECMAScript spec, only spidermonkey uses them as actual keywords, but Rhino doesn't implement that feature.
(Reporter)

Comment 2

9 years ago
Changing summary to "Improve handling of future reserved words" as I'll leave the default value for FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER as false for now, but will commit the other changes.
Summary: Change default to allow future reserved words → Improve handling of future reserved words
(Reporter)

Comment 3

9 years ago
Created attachment 348536 [details] [diff] [review]
new patch

updated patch to changes in CVS, leave default value for Context.FEATURE_RESERVED_KEYWORD_AS_IDENTIFIER as false.
Attachment #344257 - Attachment is obsolete: true
(Reporter)

Comment 4

9 years ago
Committed to CVS HEAD:

Checking in src/org/mozilla/javascript/Node.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/Node.java,v  <--  Node.java
new revision: 1.78; previous revision: 1.77
done
Checking in src/org/mozilla/javascript/TokenStream.java;
/cvsroot/mozilla/js/rhino/src/org/mozilla/javascript/TokenStream.java,v  <--  TokenStream.java
new revision: 1.74; previous revision: 1.73
done
Status: UNCONFIRMED → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.