Bug 497869 - Switch ES5's FutureReservedWords to be reserved only in strict mode, because we foolishly unreserved them once in the past. r=brendan
authorJeff Walden <jwalden@mit.edu>
Wed, 26 Jan 2011 15:02:07 -0800
changeset 61443 b57667518fd004ed97123326b16595aabc166c29
parent 61442 6962ba9824d70e91245fef9b1d2edc17c9cefaca
child 61444 9d8a15c1f22f331c17c3e7706511a32373b60494
push idunknown
push userunknown
push dateunknown
reviewersbrendan
bugs497869
milestone2.0b10pre
Bug 497869 - Switch ES5's FutureReservedWords to be reserved only in strict mode, because we foolishly unreserved them once in the past. r=brendan
js/src/jskeyword.tbl
--- a/js/src/jskeyword.tbl
+++ b/js/src/jskeyword.tbl
@@ -69,23 +69,26 @@ JS_KEYWORD(this,        TOK_PRIMARY,    
 JS_KEYWORD(throw,       TOK_THROW,      JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(try,         TOK_TRY,        JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(typeof,      TOK_UNARYOP,    JSOP_TYPEOF,    JSVERSION_DEFAULT)
 JS_KEYWORD(var,         TOK_VAR,        JSOP_DEFVAR,    JSVERSION_DEFAULT)
 JS_KEYWORD(void,        TOK_UNARYOP,    JSOP_VOID,      JSVERSION_DEFAULT)
 JS_KEYWORD(while,       TOK_WHILE,      JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(with,        TOK_WITH,       JSOP_NOP,       JSVERSION_DEFAULT)
 
-/* ES5 FutureReservedWord keywords. */
-JS_KEYWORD(class,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(enum,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(export,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(extends,     TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(import,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(super,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
+/*
+ * ES5 FutureReservedWord keywords which we historically unreserved, forcing us
+ * to re-reserve them only in strict mode.
+ */
+JS_KEYWORD(class,       TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(enum,        TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(export,      TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(extends,     TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(import,      TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(super,       TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
 
 /*
  * ES5 reserved keywords with long-implemented behavior, allowed in our
  * implementation to ease code migration.
  */
 #if JS_HAS_CONST
 JS_KEYWORD(const,       TOK_VAR,        JSOP_DEFCONST,  JSVERSION_DEFAULT)
 #else