Bug 497869 - Future reserved words are syntax errors in strict mode. r=brendan
authorJeff Walden <jwalden@mit.edu>
Sat, 22 Jan 2011 17:46:22 -0800
changeset 61227 b21d0f75e50a22a9919a5fa89d6531db5d0986bd
parent 61226 46b9f2a8343b45dc4b59a5bad97ce6db280ddab6
child 61228 3d6533055424fa46de6e9ac797e61aad3ad37501
push idunknown
push userunknown
push dateunknown
reviewersbrendan
bugs497869
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 497869 - Future reserved words are syntax errors in strict mode. r=brendan
browser/base/content/syncSetup.js
browser/components/nsBrowserGlue.js
browser/fuel/src/fuelApplication.js
content/base/test/chrome/title_window.xul
docshell/test/chrome/bug113934_window.xul
docshell/test/chrome/bug215405_window.xul
docshell/test/chrome/bug449778_window.xul
docshell/test/chrome/bug449780_window.xul
docshell/test/chrome/docshell_helpers.js
js/src/jsemit.cpp
js/src/jsinterp.cpp
js/src/jskeyword.tbl
js/src/jsopcode.cpp
js/src/jsparse.cpp
js/src/jsscan.cpp
js/src/jsscan.h
js/src/jsversion.h
js/src/tests/ecma_5/misc/future-reserved-words.js
js/src/tests/ecma_5/misc/jstests.list
js/src/tests/js1_5/Regress/jstests.list
js/src/tests/js1_5/Regress/regress-240317.js
js/src/tests/js1_5/extensions/regress-355736.js
layout/base/tests/chrome/chrome_content_integration_window.xul
layout/base/tests/chrome/chrome_over_plugin_window.xul
layout/base/tests/chrome/default_background_window.xul
layout/reftests/editor/xul/platform.js
layout/style/test/chrome/hover_helper.html
testing/mochitest/browser-harness.xul
toolkit/components/ctypes/tests/unit/test_jsctypes.js.in
toolkit/content/tests/chrome/bug263683_window.xul
toolkit/content/tests/chrome/bug331215_window.xul
toolkit/content/tests/chrome/bug451286_window.xul
toolkit/content/tests/chrome/bug451540_window.xul
--- a/browser/base/content/syncSetup.js
+++ b/browser/base/content/syncSetup.js
@@ -875,19 +875,19 @@ var gSyncSetup = {
 
     return true;
   },
 
   // sets class and string on a feedback element
   // if no property string is passed in, we clear label/style
   _setFeedback: function (element, success, string) {
     element.hidden = success || !string;
-    let class = success ? "success" : "error";
+    let classname = success ? "success" : "error";
     let image = element.getElementsByAttribute("class", "statusIcon")[0];
-    image.setAttribute("status", class);
+    image.setAttribute("status", classname);
     let label = element.getElementsByAttribute("class", "status")[0];
     label.value = string;
   },
 
   // shim
   _setFeedbackMessage: function (element, success, string) {
     let str = "";
     if (string) {
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -141,19 +141,19 @@ BrowserGlue.prototype = {
 
       if (prefDelay > 0)
         return;
     }
 
     // delays are in seconds
     const MAX_DELAY = 300;
     let delay = 3;
-    let enum = Services.wm.getEnumerator("navigator:browser");
-    while (enum.hasMoreElements()) {
-      delay += enum.getNext().gBrowser.tabs.length;
+    let browserEnum = Services.wm.getEnumerator("navigator:browser");
+    while (browserEnum.hasMoreElements()) {
+      delay += browserEnum.getNext().gBrowser.tabs.length;
     }
     delay = delay <= MAX_DELAY ? delay : MAX_DELAY;
 
     let syncTemp = {};
     Cu.import("resource://services-sync/service.js", syncTemp);
     syncTemp.Weave.Service.delayedAutoConnect(delay);
   },
 #endif
--- a/browser/fuel/src/fuelApplication.js
+++ b/browser/fuel/src/fuelApplication.js
@@ -698,20 +698,20 @@ Application.prototype = {
   get bookmarks() {
     let bookmarks = new BookmarkRoots();
     this.__defineGetter__("bookmarks", function() bookmarks);
     return this.bookmarks;
   },
 
   get windows() {
     var win = [];
-    var enum = Utilities.windowMediator.getEnumerator("navigator:browser");
+    var browserEnum = Utilities.windowMediator.getEnumerator("navigator:browser");
 
-    while (enum.hasMoreElements())
-      win.push(new Window(enum.getNext()));
+    while (browserEnum.hasMoreElements())
+      win.push(new Window(browserEnum.getNext()));
 
     return win;
   },
 
   get activeWindow() {
     return new Window(Utilities.windowMediator.getMostRecentWindow("navigator:browser"));
   }
 };
--- a/content/base/test/chrome/title_window.xul
+++ b/content/base/test/chrome/title_window.xul
@@ -16,18 +16,18 @@
   <iframe id="xul1" src="data:application/vnd.mozilla.xul+xml,&lt;window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"/>
   <iframe id="xul2" src="data:application/vnd.mozilla.xul+xml,&lt;window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul' title='Test'/>"/>
   <iframe type="content" id="svg1" src="data:text/xml,&lt;svg xmlns='http://www.w3.org/2000/svg'&gt;&lt;title id='t'&gt;Test&lt;/title&gt;&lt;/svg&gt;"/>
   <iframe type="content" id="svg2" src="data:text/xml,&lt;svg xmlns='http://www.w3.org/2000/svg'&gt;&lt;title id='t'&gt;Test&lt;/title&gt;&lt;/svg&gt;"/>
 
   <script type="application/javascript">
     <![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function testStatics() {
       function testStatic(id, expect, description) {
         is(document.getElementById(id).contentDocument.title, expect, description);
       }
 
       testStatic("html1", "Test", "HTML <title>");
--- a/docshell/test/chrome/bug113934_window.xul
+++ b/docshell/test/chrome/bug113934_window.xul
@@ -10,18 +10,18 @@
     </vbox>
     <spacer flex="1"/>
   </hbox>
   
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok", "snapshotWindow",
                     "compareSnapshots", "onerror" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function $(id) {
       return document.getElementById(id);
     }
 
     function addBrowser(parent, id, width, height) {
       var b =
--- a/docshell/test/chrome/bug215405_window.xul
+++ b/docshell/test/chrome/bug215405_window.xul
@@ -42,18 +42,18 @@
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         width="600"
         height="600"
         onload="onLoad();"
         title="215405 test">
 
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok"];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     const text="MOZILLA";
     const nostoreURI = "http://mochi.test:8888/tests/docshell/test/chrome/" +
                        "215405_nostore.html";
     const nocacheURI = "https://example.com:443/tests/docshell/test/chrome/" +
                        "215405_nocache.html";
 
--- a/docshell/test/chrome/bug449778_window.xul
+++ b/docshell/test/chrome/bug449778_window.xul
@@ -4,18 +4,18 @@
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <hbox id="parent">
   </hbox>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function $(id) {
       return document.getElementById(id);
     }
 
     function addBrowser(parent, id, width, height) {
       var b =
--- a/docshell/test/chrome/bug449780_window.xul
+++ b/docshell/test/chrome/bug449780_window.xul
@@ -4,18 +4,18 @@
   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <hbox id="parent">
   </hbox>
 
   <!-- test code goes here -->
   <script type="application/javascript"><![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function $(id) {
       return document.getElementById(id);
     }
 
     function addBrowser(parent, id, width, height) {
       var b =
--- a/docshell/test/chrome/docshell_helpers.js
+++ b/docshell/test/chrome/docshell_helpers.js
@@ -1,15 +1,15 @@
 /**  
  * Import common SimpleTest methods so that they're usable in this window.
  */
 var imports = [ "SimpleTest", "is", "isnot", "ok", "onerror", "todo", 
   "todo_is", "todo_isnot" ];
-for each (var import in imports) {
-  window[import] = window.opener.wrappedJSObject[import];
+for each (var name in imports) {
+  window[name] = window.opener.wrappedJSObject[name];
 }
 
 /**
  * Define global constants and variables.
  */
 const NAV_NONE = 0;
 const NAV_BACK = 1;
 const NAV_FORWARD = 2;
--- a/js/src/jsemit.cpp
+++ b/js/src/jsemit.cpp
@@ -7085,22 +7085,20 @@ js_EmitTree(JSContext *cx, JSCodeGenerat
 #if JS_HAS_XML_SUPPORT
       case TOK_ANYNAME:
 #endif
       case TOK_PRIMARY:
         if (js_Emit1(cx, cg, PN_OP(pn)) < 0)
             return JS_FALSE;
         break;
 
-#if JS_HAS_DEBUGGER_KEYWORD
       case TOK_DEBUGGER:
         if (js_Emit1(cx, cg, JSOP_DEBUGGER) < 0)
             return JS_FALSE;
         break;
-#endif /* JS_HAS_DEBUGGER_KEYWORD */
 
 #if JS_HAS_XML_SUPPORT
       case TOK_XMLELEM:
       case TOK_XMLLIST:
         JS_ASSERT(PN_TYPE(pn) == TOK_XMLLIST || pn->pn_count != 0);
         switch (pn->pn_head ? PN_TYPE(pn->pn_head) : TOK_XMLLIST) {
           case TOK_XMLETAGO:
             JS_ASSERT(0);
--- a/js/src/jsinterp.cpp
+++ b/js/src/jsinterp.cpp
@@ -6254,17 +6254,16 @@ BEGIN_CASE(JSOP_INSTANCEOF)
     JSBool cond = JS_FALSE;
     if (!HasInstance(cx, obj, &lref, &cond))
         goto error;
     regs.sp--;
     regs.sp[-1].setBoolean(cond);
 }
 END_CASE(JSOP_INSTANCEOF)
 
-#if JS_HAS_DEBUGGER_KEYWORD
 BEGIN_CASE(JSOP_DEBUGGER)
 {
     JSDebuggerHandler handler = cx->debugHooks->debuggerHandler;
     if (handler) {
         Value rval;
         switch (handler(cx, script, regs.pc, Jsvalify(&rval), cx->debugHooks->debuggerHandlerData)) {
         case JSTRAP_ERROR:
             goto error;
@@ -6278,17 +6277,16 @@ BEGIN_CASE(JSOP_DEBUGGER)
             cx->setPendingException(rval);
             goto error;
         default:;
         }
         CHECK_INTERRUPT_HANDLER();
     }
 }
 END_CASE(JSOP_DEBUGGER)
-#endif /* JS_HAS_DEBUGGER_KEYWORD */
 
 #if JS_HAS_XML_SUPPORT
 BEGIN_CASE(JSOP_DEFXMLNS)
 {
     if (!js_SetDefaultXMLNamespace(cx, regs.sp[-1]))
         goto error;
     regs.sp--;
 }
--- a/js/src/jskeyword.tbl
+++ b/js/src/jskeyword.tbl
@@ -33,92 +33,80 @@
  * use your version of this file under the terms of the MPL, indicate your
  * decision by deleting the provisions above and replace them with the notice
  * and other provisions required by the GPL or the LGPL. If you do not delete
  * the provisions above, a recipient may use your version of this file under
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
+/*
+ * Keywords used as primary expressions, sharing the TOK_PRIMARY token kind,
+ * distinguished by opcode.
+ */
+JS_KEYWORD(false,       TOK_PRIMARY,    JSOP_FALSE,     JSVERSION_DEFAULT)
+JS_KEYWORD(true,        TOK_PRIMARY,    JSOP_TRUE,      JSVERSION_DEFAULT)
+JS_KEYWORD(null,        TOK_PRIMARY,    JSOP_NULL,      JSVERSION_DEFAULT)
+
+/* ES5 Keywords. */
 JS_KEYWORD(break,       TOK_BREAK,      JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(case,        TOK_CASE,       JSOP_NOP,       JSVERSION_DEFAULT)
+JS_KEYWORD(catch,       TOK_CATCH,      JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(continue,    TOK_CONTINUE,   JSOP_NOP,       JSVERSION_DEFAULT)
+JS_KEYWORD(debugger,    TOK_DEBUGGER,   JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(default,     TOK_DEFAULT,    JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(delete,      TOK_DELETE,     JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(do,          TOK_DO,         JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(else,        TOK_ELSE,       JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(export,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(false,       TOK_PRIMARY,    JSOP_FALSE,     JSVERSION_DEFAULT)
+JS_KEYWORD(finally,     TOK_FINALLY,    JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(for,         TOK_FOR,        JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(function,    TOK_FUNCTION,   JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(if,          TOK_IF,         JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(in,          TOK_IN,         JSOP_IN,        JSVERSION_DEFAULT)
+JS_KEYWORD(instanceof,  TOK_INSTANCEOF, JSOP_INSTANCEOF,JSVERSION_DEFAULT)
 JS_KEYWORD(new,         TOK_NEW,        JSOP_NEW,       JSVERSION_DEFAULT)
-JS_KEYWORD(null,        TOK_PRIMARY,    JSOP_NULL,      JSVERSION_DEFAULT)
 JS_KEYWORD(return,      TOK_RETURN,     JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(switch,      TOK_SWITCH,     JSOP_NOP,       JSVERSION_DEFAULT)
 JS_KEYWORD(this,        TOK_PRIMARY,    JSOP_THIS,      JSVERSION_DEFAULT)
-JS_KEYWORD(true,        TOK_PRIMARY,    JSOP_TRUE,      JSVERSION_DEFAULT)
+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 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
 JS_KEYWORD(const,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
 #endif
-
-JS_KEYWORD(try,         TOK_TRY,        JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(catch,       TOK_CATCH,      JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(finally,     TOK_FINALLY,    JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(throw,       TOK_THROW,      JSOP_NOP,       JSVERSION_DEFAULT)
-
-JS_KEYWORD(instanceof,  TOK_INSTANCEOF, JSOP_INSTANCEOF,JSVERSION_DEFAULT)
-
-#if JS_HAS_RESERVED_JAVA_KEYWORDS
-JS_KEYWORD(abstract,    TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(boolean,     TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(byte,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(char,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(class,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(double,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(extends,     TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(final,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(float,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(goto,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(implements,  TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(import,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(int,         TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(interface,   TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(long,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(native,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(package,     TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(private,     TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(protected,   TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(public,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(short,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(static,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(super,       TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(synchronized,TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(throws,      TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(transient,   TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-JS_KEYWORD(volatile,    TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
+#if JS_HAS_BLOCK_SCOPE
+JS_KEYWORD(let,         TOK_LET,             JSOP_NOP,  JSVERSION_1_7)
+#else
+JS_KEYWORD(let,         TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_1_7)
+#endif
+#if JS_HAS_GENERATORS
+JS_KEYWORD(yield,       TOK_YIELD,           JSOP_NOP,  JSVERSION_1_7)
+#else
+JS_KEYWORD(yield,       TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_1_7)
 #endif
 
-#if JS_HAS_RESERVED_ECMA_KEYWORDS
-JS_KEYWORD(enum,        TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-#endif
-
-#if JS_HAS_DEBUGGER_KEYWORD
-JS_KEYWORD(debugger,    TOK_DEBUGGER,   JSOP_NOP,       JSVERSION_DEFAULT)
-#elif JS_HAS_RESERVED_ECMA_KEYWORDS
-JS_KEYWORD(debugger,    TOK_RESERVED,   JSOP_NOP,       JSVERSION_DEFAULT)
-#endif
-
-#if JS_HAS_GENERATORS
-JS_KEYWORD(yield,       TOK_YIELD,      JSOP_NOP,       JSVERSION_1_7)
-#endif
-
-#if JS_HAS_BLOCK_SCOPE
-JS_KEYWORD(let,         TOK_LET,        JSOP_NOP,       JSVERSION_1_7)
-#endif
+/* ES5 future reserved keywords in strict mode. */
+JS_KEYWORD(implements,  TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(interface,   TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(package,     TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(private,     TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(protected,   TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(public,      TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
+JS_KEYWORD(static,      TOK_STRICT_RESERVED, JSOP_NOP,  JSVERSION_DEFAULT)
--- a/js/src/jsopcode.cpp
+++ b/js/src/jsopcode.cpp
@@ -4608,22 +4608,20 @@ Decompile(SprintStack *ss, jsbytecode *p
                 break;
 
               case JSOP_USESHARP:
                 i = (jsint) GET_UINT16(pc + UINT16_LEN);
                 todo = Sprint(&ss->sprinter, "#%u#", (unsigned) i);
                 break;
 #endif /* JS_HAS_SHARP_VARS */
 
-#if JS_HAS_DEBUGGER_KEYWORD
               case JSOP_DEBUGGER:
                 js_printf(jp, "\tdebugger;\n");
                 todo = -2;
                 break;
-#endif /* JS_HAS_DEBUGGER_KEYWORD */
 
 #if JS_HAS_XML_SUPPORT
               case JSOP_STARTXML:
               case JSOP_STARTXMLEXPR:
                 inXML = op == JSOP_STARTXML;
                 todo = -2;
                 break;
 
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -6198,25 +6198,23 @@ Parser::statement()
       case TOK_EOL:
       case TOK_SEMI:
         pn = UnaryNode::create(tc);
         if (!pn)
             return NULL;
         pn->pn_type = TOK_SEMI;
         return pn;
 
-#if JS_HAS_DEBUGGER_KEYWORD
       case TOK_DEBUGGER:
         pn = NullaryNode::create(tc);
         if (!pn)
             return NULL;
         pn->pn_type = TOK_DEBUGGER;
         tc->flags |= TCF_FUN_HEAVYWEIGHT;
         break;
-#endif /* JS_HAS_DEBUGGER_KEYWORD */
 
 #if JS_HAS_XML_SUPPORT
       case TOK_DEFAULT:
       {
         pn = UnaryNode::create(tc);
         if (!pn)
             return NULL;
         if (!tokenStream.matchToken(TOK_NAME) ||
--- a/js/src/jsscan.cpp
+++ b/js/src/jsscan.cpp
@@ -1038,20 +1038,28 @@ TokenStream::getTokenInternal()
         /*
          * Check for keywords unless we saw Unicode escape or parser asks
          * to ignore keywords.
          */
         if (!hadUnicodeEscape &&
             !(flags & TSF_KEYWORD_IS_NAME) &&
             (kw = FindKeyword(tokenbuf.begin(), tokenbuf.length()))) {
             if (kw->tokentype == TOK_RESERVED) {
-                if (!ReportCompileErrorNumber(cx, this, NULL, JSREPORT_WARNING | JSREPORT_STRICT,
+                if (!ReportCompileErrorNumber(cx, this, NULL, JSREPORT_ERROR,
                                               JSMSG_RESERVED_ID, kw->chars)) {
                     goto error;
                 }
+            } else if (kw->tokentype == TOK_STRICT_RESERVED) {
+                if (isStrictMode()
+                    ? !ReportStrictModeError(cx, this, NULL, NULL, JSMSG_RESERVED_ID, kw->chars)
+                    : !ReportCompileErrorNumber(cx, this, NULL,
+                                                JSREPORT_STRICT | JSREPORT_WARNING,
+                                                JSMSG_RESERVED_ID, kw->chars)) {
+                    goto error;
+                }
             } else if (kw->version <= VersionNumber(version)) {
                 tt = kw->tokentype;
                 tp->t_op = (JSOp) kw->op;
                 goto out;
             }
         }
 
         atom = atomize(cx, tokenbuf);
--- a/js/src/jsscan.h
+++ b/js/src/jsscan.h
@@ -139,16 +139,17 @@ enum TokenKind {
     TOK_SEQ = 82,                       /* synthetic sequence of statements,
                                            not a block */
     TOK_FORHEAD = 83,                   /* head of for(;;)-style loop */
     TOK_ARGSBODY = 84,                  /* formal args in list + body at end */
     TOK_UPVARS = 85,                    /* lexical dependencies as JSAtomList
                                            of definitions paired with a parse
                                            tree full of uses of those names */
     TOK_RESERVED,                       /* reserved keywords */
+    TOK_STRICT_RESERVED,                /* reserved keywords in strict mode */
     TOK_LIMIT                           /* domain size */
 };
 
 static inline bool
 TokenKindIsXML(TokenKind tt)
 {
     return tt == TOK_AT || tt == TOK_DBLCOLON || tt == TOK_ANYNAME;
 }
--- a/js/src/jsversion.h
+++ b/js/src/jsversion.h
@@ -84,17 +84,16 @@
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
 #else
 #define JS_HAS_OBJ_PROTO_PROP   0       /* has o.__proto__ etc. */
 #endif
 #define JS_HAS_OBJ_WATCHPOINT   0       /* has o.watch and o.unwatch */
 #define JS_HAS_SHARP_VARS       0       /* has #n=, #n# for object literals */
 #define JS_HAS_XDR              0       /* has XDR API and internal support */
 #define JS_HAS_TOSOURCE         0       /* has Object/Array toSource method */
-#define JS_HAS_DEBUGGER_KEYWORD 0       /* has hook for debugger keyword */
 #define JS_HAS_CATCH_GUARD      0       /* has exception handling catch guard */
 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
 #define JS_HAS_UNEVAL           0       /* has uneval() top-level function */
 #define JS_HAS_CONST            0       /* has JS2 const as alternative var */
 #define JS_HAS_FUN_EXPR_STMT    0       /* has function expression statement */
 #define JS_HAS_NO_SUCH_METHOD   0       /* has o.__noSuchMethod__ handler */
 #define JS_HAS_XML_SUPPORT      0       /* has ECMAScript for XML support */
 #define JS_HAS_ARRAY_EXTRAS     0       /* has indexOf and Lispy extras */
@@ -112,17 +111,16 @@
 
 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
 #define JS_HAS_XDR              1       /* has XDR API and internal support */
 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
-#define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
 #define JS_HAS_XML_SUPPORT      0       /* has ECMAScript for XML support */
 #define JS_HAS_ARRAY_EXTRAS     0       /* has indexOf and Lispy extras */
@@ -136,17 +134,16 @@
 
 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
 #define JS_HAS_XDR              1       /* has XDR API and internal support */
 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
-#define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
 #define JS_HAS_XML_SUPPORT      1       /* has ECMAScript for XML support */
 #define JS_HAS_ARRAY_EXTRAS     1       /* has indexOf and Lispy extras */
@@ -160,17 +157,16 @@
 
 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
 #define JS_HAS_XDR              1       /* has XDR API and internal support */
 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
-#define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
 #define JS_HAS_XML_SUPPORT      1       /* has ECMAScript for XML support */
 #define JS_HAS_ARRAY_EXTRAS     1       /* has indexOf and Lispy extras */
@@ -184,17 +180,16 @@
 
 #define JS_HAS_STR_HTML_HELPERS 1       /* has str.anchor, str.bold, etc. */
 #define JS_HAS_PERL_SUBSTR      1       /* has str.substr */
 #define JS_HAS_OBJ_PROTO_PROP   1       /* has o.__proto__ etc. */
 #define JS_HAS_OBJ_WATCHPOINT   1       /* has o.watch and o.unwatch */
 #define JS_HAS_SHARP_VARS       1       /* has #n=, #n# for object literals */
 #define JS_HAS_XDR              1       /* has XDR API and internal support */
 #define JS_HAS_TOSOURCE         1       /* has Object/Array toSource method */
-#define JS_HAS_DEBUGGER_KEYWORD 1       /* has hook for debugger keyword */
 #define JS_HAS_CATCH_GUARD      1       /* has exception handling catch guard */
 #define JS_HAS_SPARSE_ARRAYS    0       /* array methods preserve empty elems */
 #define JS_HAS_UNEVAL           1       /* has uneval() top-level function */
 #define JS_HAS_CONST            1       /* has JS2 const as alternative var */
 #define JS_HAS_FUN_EXPR_STMT    1       /* has function expression statement */
 #define JS_HAS_NO_SUCH_METHOD   1       /* has o.__noSuchMethod__ handler */
 #define JS_HAS_XML_SUPPORT      1       /* has ECMAScript for XML support */
 #define JS_HAS_ARRAY_EXTRAS     1       /* has indexOf and Lispy extras */
@@ -205,20 +200,16 @@
 #define JS_HAS_EXPR_CLOSURES    1       /* has function (formals) listexpr */
 
 #else
 
 #error "unknown JS_VERSION"
 
 #endif
 
-/* Features that are present in all versions. */
-#define JS_HAS_RESERVED_JAVA_KEYWORDS   1
-#define JS_HAS_RESERVED_ECMA_KEYWORDS   1
-
 /* Support for JS_NewGlobalObject. */
 #define JS_HAS_NEW_GLOBAL_OBJECT        1
 
 /* Support for JS_MakeSystemObject. */
 #define JS_HAS_MAKE_SYSTEM_OBJECT       1
 
 /* Feature-test macro for evolving destructuring support. */
 #define JS_HAS_DESTRUCTURING_SHORTHAND  (JS_HAS_DESTRUCTURING == 2)
new file mode 100644
--- /dev/null
+++ b/js/src/tests/ecma_5/misc/future-reserved-words.js
@@ -0,0 +1,122 @@
+/*
+ * Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/licenses/publicdomain/
+ */
+
+//-----------------------------------------------------------------------------
+var BUGNUMBER = 497869;
+var summary = "Implement FutureReservedWords per-spec";
+
+print(BUGNUMBER + ": " + summary);
+
+/**************
+ * BEGIN TEST *
+ **************/
+
+var futureReservedWords =
+  ["class",
+   // "const", // Mozilla extension enabled even for versionless code
+   "enum",
+   "export",
+   "extends",
+   "import",
+   "super"];
+
+var strictFutureReservedWords =
+  [
+   "implements",
+   "interface",
+   // "let", // Mozilla extension, strict checks disabled for now
+   "package",
+   "private",
+   "protected",
+   "public",
+   "static",
+   // "yield", // Mozilla extension, strict checks disabled for now
+  ];
+
+function testWord(word, expectNormal, expectStrict)
+{
+  var actual, status;
+
+  // USE IN VARIABLE DECLARATION
+
+  actual = "";
+  status = summary + ", normal var: " + word;
+  try
+  {
+    eval("var " + word + ";");
+    actual = "no error";
+  }
+  catch (e)
+  {
+    actual = "error";
+    status +=  ", " + e.name + ": " + e.message + " ";
+  }
+  reportCompare(expectNormal, actual, status);
+
+  actual = "";
+  status = summary + ", strict var: " + word;
+  try
+  {
+    eval("'use strict'; var " + word + ";");
+    actual = "no error";
+  }
+  catch (e)
+  {
+    actual = "error";
+    status +=  ", " + e.name + ": " + e.message + " ";
+  }
+  reportCompare(expectStrict, actual, status);
+
+
+  // USE AS LHS FOR ASSIGNMENT
+
+  actual = "";
+  status = summary + ", normal assignment: " + word;
+  try
+  {
+    eval(word + " = 'foo';");
+    actual = "no error";
+  }
+  catch(e)
+  {
+    actual = "error";
+    status +=  ", " + e.name + ": " + e.message + " ";
+  }
+  reportCompare(expectNormal, actual, status);
+
+  actual = "";
+  status = summary + ", strict assignment: " + word;
+  try
+  {
+    eval("'use strict'; " + word + " = 'foo';");
+    actual = "no error";
+  }
+  catch(e)
+  {
+    actual = "error";
+    status +=  ", " + e.name + ": " + e.message + " ";
+  }
+  reportCompare(expectStrict, actual, status);
+}
+
+function testFutureReservedWord(word)
+{
+  testWord(word, "error", "error");
+}
+
+function testStrictFutureReservedWord(word)
+{
+  testWord(word, "no error", "error");
+}
+
+futureReservedWords.forEach(testFutureReservedWord);
+strictFutureReservedWords.forEach(testStrictFutureReservedWord);
+
+/******************************************************************************/
+
+if (typeof reportCompare === "function")
+  reportCompare(true, true);
+
+print("All tests passed!");
--- a/js/src/tests/ecma_5/misc/jstests.list
+++ b/js/src/tests/ecma_5/misc/jstests.list
@@ -1,8 +1,9 @@
 url-prefix ../../jsreftest.html?test=ecma_5/misc/
 script global-numeric-properties.js
 script redeclare-var-non-writable-property.js
 script enumerate-undefined.js
 script unwrapped-no-such-method.js
 script explicit-undefined-optional-argument.js
 script function-definition-eval.js
 skip-if(!xulRuntime.shell) script function-definition-evaluate.js # needs evaluate()
+script future-reserved-words.js
--- a/js/src/tests/js1_5/Regress/jstests.list
+++ b/js/src/tests/js1_5/Regress/jstests.list
@@ -55,17 +55,16 @@ script regress-229006.js
 script regress-230216-1.js
 script regress-230216-2.js
 script regress-230216-3.js
 script regress-233483-2.js
 script regress-233483.js
 script regress-234389.js
 script regress-238881.js
 script regress-238945.js
-script regress-240317.js
 script regress-240577.js
 script regress-243174.js
 script regress-243389-n.js
 script regress-243869.js
 script regress-244470.js
 script regress-244619.js
 script regress-245113.js
 script regress-245308.js
deleted file mode 100644
--- a/js/src/tests/js1_5/Regress/regress-240317.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/licenses/publicdomain/
- * Contributor: Bob Clary
- */
-
-//-----------------------------------------------------------------------------
-var BUGNUMBER = 240317;
-var summary = 'Using Reserved identifiers warns';
-var actual = '';
-var expect = 'no error';
-
-printBugNumber(BUGNUMBER);
-printStatus (summary);
-
-function testvar(words)
-{
-  var e;
-  expect = 'no error';
-  for (var i = 0; i < words.length; i++)
-  {
-    var word = words[i];
-
-    actual = '';
-    status = summary + ': ' + word;
-    try
-    {
-      eval('var ' + word + ';');
-      actual = 'no error';
-    }
-    catch(e)
-    {
-      actual = 'error';
-      status +=  ', ' + e.name + ': ' + e.message + ' ';
-    }
-    reportCompare(expect, actual, status);
-
-    actual = '';
-    status = summary + ': ' + word;
-    try
-    {
-      eval(word + ' = "foo";');
-      actual = 'no error';
-    }
-    catch(e)
-    {
-      actual = 'error';
-      status +=  ', ' + e.name + ': ' + e.message + ' ';
-    }
-    reportCompare(expect, actual, status);
-
-  }
-}
-
-// future reserved words
-var reserved =
-  ['abstract',    'enum',      'int',      'short',      'boolean',
-   'interface', 'static',   'byte',       'extends',
-   'long',         'super',     'char',     'final',      'native',
-   'synchronized', 'class',     'float',    'package',    'throws',
-   'goto',      'private',  'transient',             
-   'implements',   'protected', 'volatile', 'double',               
-   'public'];
-
-testvar(reserved);
- 
-
--- a/js/src/tests/js1_5/extensions/regress-355736.js
+++ b/js/src/tests/js1_5/extensions/regress-355736.js
@@ -47,23 +47,23 @@ test();
 //-----------------------------------------------------------------------------
 
 function test()
 {
   enterFunc ('test');
   printBugNumber(BUGNUMBER);
   printStatus (summary);
  
-  f = function() { [super] = q; };
-  expect = 'function() { [super] = q; }';
+  f = function() { [implements] = q; };
+  expect = 'function() { [implements] = q; }';
   actual = f + '';
   compareSource(expect, actual, summary + ': 1');
 
-  f = function() { return { get super() { } } };
-  expect = 'function() { return { get super() { } }; }';
+  f = function() { return { get implements() { } } };
+  expect = 'function() { return { get implements() { } }; }';
   actual = f + '';
   compareSource(expect, actual, summary + ': 2');
 
   f = function() { [goto] = a };
   expect = 'function() { [goto] = a; }';
   actual = f + '';
   compareSource(expect, actual, summary + ': 3');
 
--- a/layout/base/tests/chrome/chrome_content_integration_window.xul
+++ b/layout/base/tests/chrome/chrome_content_integration_window.xul
@@ -16,18 +16,18 @@
             src="data:text/html,&lt;div style='position:absolute;left:0;top:0;width:100%;height:100px;background:yellow;border-bottom:100px solid black'&gt;"/>
     <!-- the top 100px is a strip of black above the content iframe -->
     <vbox style="border-top:100px solid black;"/>
   </stack>
 
   <script type="application/javascript">
     <![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
     
     function runTests() {
       var testCanvas = snapshotWindow(window);
 
       var refCanvas = snapshotWindow(window);
       var ctx = refCanvas.getContext('2d');
       ctx.fillStyle = "black";
--- a/layout/base/tests/chrome/chrome_over_plugin_window.xul
+++ b/layout/base/tests/chrome/chrome_over_plugin_window.xul
@@ -17,18 +17,18 @@
       <vbox style="height:25px; background:rgba(0,128,0,0.5);"/> <!-- plugin should be covered here -->
       <vbox style="height:50px;"/> <!-- plugin should be visible here -->
     </vbox>
   </stack>
 
   <script type="application/javascript">
     <![CDATA[
     var imports = [ "SimpleTest", "is", "isnot", "ok", "todo" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     var plugin;
     function waitForPaint() {
       if (plugin.getPaintCount() < 1) {
         setTimeout(waitForPaint, 0);
         return;
       }
--- a/layout/base/tests/chrome/default_background_window.xul
+++ b/layout/base/tests/chrome/default_background_window.xul
@@ -13,18 +13,18 @@
 
   <iframe type="content" id="f" src="about:blank" style="border:1px solid black;"/>
 
   <script type="application/javascript">
   <![CDATA[
     SimpleTest.waitForExplicitFinish();
 
     var imports = [ "SimpleTest", "is", "isnot", "ok" ];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
     
     function snapshot(win) {
       var el = document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
       el.width = win.innerWidth;
       el.height = win.innerHeight;
 
       var ctx = el.getContext("2d");
--- a/layout/reftests/editor/xul/platform.js
+++ b/layout/reftests/editor/xul/platform.js
@@ -4,25 +4,25 @@
 // platform.
 
 var id;
 var ua = navigator.userAgent;
 
 if (/Windows/.test(ua)) {
   id = "win";
   if (/NT 5\.1/.test(ua) || /NT 5\.2; Win64/.test(ua))
-    var class = "winxp";
+    var classname = "winxp";
 }
 else if (/Linux/.test(ua))
   id = "linux";
 else if (/SunOS/.test(ua))
   id = "linux";
 else if (/Mac OS X/.test(ua))
   id = "mac";
 
 if (id)
   document.documentElement.setAttribute("id", id);
 else
   document.documentElement.appendChild(
     document.createTextNode("Unrecognized platform")
   );
-if (class)
-  document.documentElement.setAttribute("class", class);
+if (classname)
+  document.documentElement.setAttribute("class", classname);
--- a/layout/style/test/chrome/hover_helper.html
+++ b/layout/style/test/chrome/hover_helper.html
@@ -31,18 +31,18 @@
     <div style="width: 5000px; height: 10px;"></div>
   </div>
 
 </div>
 <pre id="test">
 <script type="application/javascript">
 
 var imports = [ "SimpleTest", "is", "isnot", "ok" ];
-for each (var import in imports) {
-    window[import] = window.opener.wrappedJSObject[import];
+for each (var name in imports) {
+    window[name] = window.opener.wrappedJSObject[name];
 }
 
 var div = document.getElementById("display");
 var divtwo = document.getElementById("two");
 var iframe = document.getElementById("twoi");
 var divtwoparent = document.getElementById("twoparent");
 
 iframe.contentDocument.open();
--- a/testing/mochitest/browser-harness.xul
+++ b/testing/mochitest/browser-harness.xul
@@ -199,18 +199,18 @@
       get htmlLog() {
         let txtToHTML = Cc["@mozilla.org/txttohtmlconv;1"].
                         getService(Ci.mozITXTToHTMLConv);
         function _entityEncode(str) {
           return txtToHTML.scanTXT(str, Ci.mozITXTToHTMLConv.kEntities);
         }
         var path = _entityEncode(this.path);
         var html = this.results.map(function (t) {
-          var class = t.info ? "info" : "result " + (t.pass ? "passed" : "failed");
-          return "<p class=\"" + class + "\">" + t.result + " | " + path +
+          var classname = t.info ? "info" : "result " + (t.pass ? "passed" : "failed");
+          return "<p class=\"" + classname + "\">" + t.result + " | " + path +
                  " | " + _entityEncode(t.msg) + "</p>";
         }).join("\n");
         if (this.duration) {
           html += "<p class=\"info\">TEST-END | " + path + " | finished in " +
                   this.duration + " ms</p>";
         }
         return html;
       }
--- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js.in
+++ b/toolkit/components/ctypes/tests/unit/test_jsctypes.js.in
@@ -77,22 +77,22 @@ function do_check_throws(f, type, stack)
       do_check_true(true);
       return;
     }
     do_throw("expected " + type.name + " exception, caught " + exc, stack);
   }
   do_throw("expected " + type.name + " exception, none thrown", stack);
 }
 
-function do_check_class(obj, class, stack)
+function do_check_class(obj, classname, stack)
 {
   if (!stack)
     stack = Components.stack.caller;
 
-  do_check_eq(Object.prototype.toString.call(obj), "[object " + class + "]", stack);
+  do_check_eq(Object.prototype.toString.call(obj), "[object " + classname + "]", stack);
 }
 
 function run_test()
 {
   // Test ctypes.CType and ctypes.CData are set up correctly.
   run_abstract_class_tests();
 
   // open the library
--- a/toolkit/content/tests/chrome/bug263683_window.xul
+++ b/toolkit/content/tests/chrome/bug263683_window.xul
@@ -50,18 +50,18 @@
     const Ci = Components.interfaces;
     const Cc = Components.classes;
     const Cr = Components.results;
 
     var gFindBar = null;
     var gBrowser;
 
     var imports = ["SimpleTest", "ok"];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function finish() {
       window.close();
       SimpleTest.finish();
     }
 
     function startTest() {
--- a/toolkit/content/tests/chrome/bug331215_window.xul
+++ b/toolkit/content/tests/chrome/bug331215_window.xul
@@ -50,18 +50,18 @@
     const Ci = Components.interfaces;
     const Cc = Components.classes;
     const Cr = Components.results;
 
     var gFindBar = null;
     var gBrowser;
 
     var imports = ["SimpleTest", "ok"];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function finish() {
       window.close();
       SimpleTest.finish();
     }
 
     function startTest() {
--- a/toolkit/content/tests/chrome/bug451286_window.xul
+++ b/toolkit/content/tests/chrome/bug451286_window.xul
@@ -52,18 +52,18 @@
     const Cr = Components.results;
     const SEARCH_TEXT = "text";
     const DATAURI = "data:text/html," + SEARCH_TEXT;
 
     var gFindBar = null;
     var gBrowser;
 
     var imports = ["SimpleTest", "ok", "snapshotWindow", "compareSnapshots"];
-    for each (var import in imports) {
-      window[import] = window.opener.wrappedJSObject[import];
+    for each (var name in imports) {
+      window[name] = window.opener.wrappedJSObject[name];
     }
 
     function finish() {
       window.close();
       SimpleTest.finish();
     }
 
     function startTest() {
--- a/toolkit/content/tests/chrome/bug451540_window.xul
+++ b/toolkit/content/tests/chrome/bug451540_window.xul
@@ -57,18 +57,18 @@
     var sendCtrl = true;
     var sendMeta = false;
     if (navigator.platform.indexOf("Mac") >= 0) {
       sendCtrl = false;
       sendMeta = true;
     }
 
     var imports = [ "SimpleTest", "ok"];
-      for each (var import in imports) {
-        window[import] = window.opener.wrappedJSObject[import];
+      for each (var name in imports) {
+        window[name] = window.opener.wrappedJSObject[name];
       }
 
 
     function finishTest() {
       window.close();
       SimpleTest.finish();
     }