Backed out changeset 7e69e102a432 (bug 823978) for bustage.
authorRyan VanderMeulen <ryanvm@gmail.com>
Tue, 11 Jun 2013 14:28:17 -0400
changeset 146169 f6efe035de74b45e0d3279abc2e309fe3b591ed9
parent 146168 bcb4e711f4ebae69836dfdd0faa03148a23f7fbf
child 146170 c40c7b5d714d175bd4b5161fa8a036b33c2a2265
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs823978
milestone24.0a1
backs out7e69e102a432581678426e51f11f8aac1f23a251
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
Backed out changeset 7e69e102a432 (bug 823978) for bustage. CLOSED TREE
dom/base/nsJSEnvironment.cpp
dom/workers/RuntimeService.cpp
js/src/frontend/ParseNode.h
js/src/frontend/Parser.cpp
js/src/frontend/SharedContext-inl.h
js/src/frontend/SharedContext.h
js/src/frontend/TokenStream.cpp
js/src/jit-test/tests/basic/bug823310.js
js/src/jsapi.h
js/src/jsarray.cpp
js/src/jscntxt.cpp
js/src/jscntxt.h
js/src/jsobj.cpp
js/src/shell/js.cpp
js/xpconnect/shell/xpcshell.cpp
js/xpconnect/src/XPCComponents.cpp
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -983,19 +983,19 @@ nsJSContext::JSOptionChangedCallback(con
 
   sPostGCEventsToConsole = Preferences::GetBool(js_memlog_option_str);
   sPostGCEventsToObserver = Preferences::GetBool(js_memnotify_option_str);
   sDisableExplicitCompartmentGC =
     Preferences::GetBool(js_disable_explicit_compartment_gc);
 
   bool strict = Preferences::GetBool(js_strict_option_str);
   if (strict)
-    newDefaultJSOptions |= JSOPTION_EXTRA_WARNINGS;
+    newDefaultJSOptions |= JSOPTION_STRICT;
   else
-    newDefaultJSOptions &= ~JSOPTION_EXTRA_WARNINGS;
+    newDefaultJSOptions &= ~JSOPTION_STRICT;
 
   // The vanilla GetGlobalObject returns null if a global isn't set up on
   // the context yet. We can sometimes be call midway through context init,
   // So ask for the member directly instead.
   nsIScriptGlobalObject *global = context->GetGlobalObjectRef();
 
   // XXX should we check for sysprin instead of a chrome window, to make
   // XXX components be covered by the chrome pref instead of the content one?
@@ -1051,19 +1051,19 @@ nsJSContext::JSOptionChangedCallback(con
     newDefaultJSOptions |= JSOPTION_ASMJS;
   else
     newDefaultJSOptions &= ~JSOPTION_ASMJS;
 
 #ifdef DEBUG
   // In debug builds, warnings are enabled in chrome context if
   // javascript.options.strict.debug is true
   bool strictDebug = Preferences::GetBool(js_strict_debug_option_str);
-  if (strictDebug && (newDefaultJSOptions & JSOPTION_EXTRA_WARNINGS) == 0) {
+  if (strictDebug && (newDefaultJSOptions & JSOPTION_STRICT) == 0) {
     if (chromeWindow || !contentWindow)
-      newDefaultJSOptions |= JSOPTION_WARNINGS;
+      newDefaultJSOptions |= JSOPTION_STRICT;
   }
 #endif
 
   bool werror = Preferences::GetBool(js_werror_option_str);
   if (werror)
     newDefaultJSOptions |= JSOPTION_WERROR;
   else
     newDefaultJSOptions &= ~JSOPTION_WERROR;
--- a/dom/workers/RuntimeService.cpp
+++ b/dom/workers/RuntimeService.cpp
@@ -280,17 +280,17 @@ LoadJSContextOptions(const char* aPrefNa
       prefName.EqualsLiteral(PREF_WORKERS_OPTIONS_PREFIX PREF_GCZEAL)) {
     return 0;
   }
 #endif
 
   // Common options.
   uint32_t commonOptions = kRequiredJSContextOptions;
   if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("strict"))) {
-    commonOptions |= JSOPTION_EXTRA_WARNINGS;
+    commonOptions |= JSOPTION_STRICT;
   }
   if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("werror"))) {
     commonOptions |= JSOPTION_WERROR;
   }
   if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("typeinference"))) {
     commonOptions |= JSOPTION_TYPE_INFERENCE;
   }
   if (GetWorkerPref<bool>(NS_LITERAL_CSTRING("asmjs"))) {
--- a/js/src/frontend/ParseNode.h
+++ b/js/src/frontend/ParseNode.h
@@ -1314,17 +1314,17 @@ class ObjectBox {
 
     ObjectBox(JSFunction *function, ObjectBox *traceLink);
     ObjectBox(Module *module, ObjectBox *traceLink);
 };
 
 enum ParseReportKind {
     ParseError,
     ParseWarning,
-    ParseExtraWarning,
+    ParseStrictWarning,
     ParseStrictError
 };
 
 enum FunctionSyntaxKind { Expression, Statement, Arrow };
 
 } /* namespace frontend */
 } /* namespace js */
 
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -345,17 +345,17 @@ Parser<ParseHandler>::reportHelper(Parse
     switch (kind) {
       case ParseError:
         result = tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_ERROR, errorNumber, args);
         break;
       case ParseWarning:
         result =
             tokenStream.reportCompileErrorNumberVA(offset, JSREPORT_WARNING, errorNumber, args);
         break;
-      case ParseExtraWarning:
+      case ParseStrictWarning:
         result = tokenStream.reportStrictWarningErrorNumberVA(offset, errorNumber, args);
         break;
       case ParseStrictError:
         result = tokenStream.reportStrictModeErrorNumberVA(offset, strict, errorNumber, args);
         break;
     }
     return result;
 }
@@ -419,20 +419,20 @@ Parser<ParseHandler>::Parser(JSContext *
     abortedSyntaxParse(false),
     handler(cx, tokenStream, foldConstants, syntaxParser, lazyOuterFunction)
 {
     // XXX bug 678037 always disable syntax parsing for now.
     handler.disableSyntaxParser();
 
     cx->runtime()->activeCompilations++;
 
-    // The Mozilla specific JSOPTION_EXTRA_WARNINGS option adds extra warnings
-    // which are not generated if functions are parsed lazily. Note that the
-    // standard "use strict" does not inhibit lazy parsing.
-    if (context->hasExtraWarningsOption())
+    // The Mozilla specific 'strict' option adds extra warnings which are not
+    // generated if functions are parsed lazily. Note that the standard
+    // "use strict" does not inhibit lazy parsing.
+    if (context->hasStrictOption())
         handler.disableSyntaxParser();
 
     tempPoolMark = cx->tempLifoAlloc().mark();
 }
 
 template <typename ParseHandler>
 Parser<ParseHandler>::~Parser()
 {
@@ -787,17 +787,17 @@ Parser<ParseHandler>::reportBadReturn(No
 }
 
 template <typename ParseHandler>
 bool
 Parser<ParseHandler>::checkFinalReturn(Node pn)
 {
     JS_ASSERT(pc->sc->isFunctionBox());
     return HasFinalReturn(pn) == ENDS_IN_RETURN ||
-           reportBadReturn(pn, ParseExtraWarning,
+           reportBadReturn(pn, ParseStrictWarning,
                            JSMSG_NO_RETURN_VALUE, JSMSG_ANON_NO_RETURN_VALUE);
 }
 
 /*
  * Check that it is permitted to assign to lhs.  Strict mode code may not
  * assign to 'eval' or 'arguments'.
  */
 template <typename ParseHandler>
@@ -1055,17 +1055,17 @@ Parser<ParseHandler>::functionBody(Funct
             reportBadReturn(pn, ParseError,
                             JSMSG_BAD_GENERATOR_RETURN,
                             JSMSG_BAD_ANON_GENERATOR_RETURN);
             return null();
         }
     }
 
     /* Check for falling off the end of a function that returns a value. */
-    if (context->hasExtraWarningsOption() && pc->funHasReturnExpr && !checkFinalReturn(pn))
+    if (context->hasStrictOption() && pc->funHasReturnExpr && !checkFinalReturn(pn))
         return null();
 
     if (kind != Arrow) {
         /* Define the 'arguments' binding if necessary. Arrow functions don't have 'arguments'. */
         if (!checkFunctionArguments())
             return null();
     }
 
@@ -1711,20 +1711,20 @@ Parser<FullParseHandler>::checkFunctionD
         /*
          * Handle redeclaration and optimize cases where we can statically bind the
          * function (thereby avoiding JSOP_DEFFUN and dynamic name lookup).
          */
         if (Definition *dn = pc->decls().lookupFirst(funName)) {
             JS_ASSERT(!dn->isUsed());
             JS_ASSERT(dn->isDefn());
 
-            if (context->hasExtraWarningsOption() || dn->kind() == Definition::CONST) {
+            if (context->hasStrictOption() || dn->kind() == Definition::CONST) {
                 JSAutoByteString name;
                 ParseReportKind reporter = (dn->kind() != Definition::CONST)
-                                           ? ParseExtraWarning
+                                           ? ParseStrictWarning
                                            : ParseError;
                 if (!js_AtomToPrintableString(context, funName, &name) ||
                     !report(reporter, false, NULL, JSMSG_REDECLARED_VAR,
                             Definition::kindString(dn->kind()), name.ptr()))
                 {
                     return false;
                 }
             }
@@ -2605,17 +2605,17 @@ Parser<ParseHandler>::condition()
     MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_BEFORE_COND);
     Node pn = parenExpr();
     if (!pn)
         return null();
     MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_AFTER_COND);
 
     /* Check for (a = b) and warn about possible (a == b) mistype. */
     if (handler.isOperationWithoutParens(pn, PNK_ASSIGN) &&
-        !report(ParseExtraWarning, false, null(), JSMSG_EQUAL_AS_ASSIGN))
+        !report(ParseStrictWarning, false, null(), JSMSG_EQUAL_AS_ASSIGN))
     {
         return null();
     }
     return pn;
 }
 
 static bool
 MatchLabel(JSContext *cx, TokenStream *ts, MutableHandlePropertyName label)
@@ -2879,30 +2879,30 @@ Parser<ParseHandler>::bindVarOrConst(JSC
         JSAutoByteString bytes;
         if (!js_AtomToPrintableString(cx, name, &bytes))
             return false;
 
         if (isConstDecl) {
             parser->report(ParseError, false, pn, JSMSG_REDECLARED_PARAM, bytes.ptr());
             return false;
         }
-        if (!parser->report(ParseExtraWarning, false, pn, JSMSG_VAR_HIDES_ARG, bytes.ptr()))
+        if (!parser->report(ParseStrictWarning, false, pn, JSMSG_VAR_HIDES_ARG, bytes.ptr()))
             return false;
     } else {
         bool error = (isConstDecl ||
                       dn_kind == Definition::CONST ||
                       (dn_kind == Definition::LET &&
                        (stmt->type != STMT_CATCH || OuterLet(pc, stmt, name))));
 
-        if (cx->hasExtraWarningsOption()
+        if (cx->hasStrictOption()
             ? data->op != JSOP_DEFVAR || dn_kind != Definition::VAR
             : error)
         {
             JSAutoByteString bytes;
-            ParseReportKind reporter = error ? ParseError : ParseExtraWarning;
+            ParseReportKind reporter = error ? ParseError : ParseStrictWarning;
             if (!js_AtomToPrintableString(cx, name, &bytes) ||
                 !parser->report(reporter, false, pn, JSMSG_REDECLARED_VAR,
                                 Definition::kindString(dn_kind), bytes.ptr()))
             {
                 return false;
             }
         }
     }
@@ -3283,18 +3283,18 @@ Parser<ParseHandler>::returnOrYield(bool
 
     if (pc->funHasReturnExpr && pc->sc->asFunctionBox()->isGenerator()) {
         /* As in Python (see PEP-255), disallow return v; in generators. */
         reportBadReturn(pn, ParseError, JSMSG_BAD_GENERATOR_RETURN,
                         JSMSG_BAD_ANON_GENERATOR_RETURN);
         return null();
     }
 
-    if (context->hasExtraWarningsOption() && pc->funHasReturnExpr && pc->funHasReturnVoid &&
-        !reportBadReturn(pn, ParseExtraWarning,
+    if (context->hasStrictOption() && pc->funHasReturnExpr && pc->funHasReturnVoid &&
+        !reportBadReturn(pn, ParseStrictWarning,
                          JSMSG_NO_RETURN_VALUE, JSMSG_ANON_NO_RETURN_VALUE))
     {
         return null();
     }
 
     return pn;
 }
 
@@ -4315,20 +4315,20 @@ Parser<ParseHandler>::withStatement()
 {
     if (!abortIfSyntaxParser())
         return null();
 
     JS_ASSERT(tokenStream.isCurrentTokenType(TOK_WITH));
     uint32_t begin = tokenStream.currentToken().pos.begin;
 
     // In most cases, we want the constructs forbidden in strict mode code to be
-    // a subset of those that JSOPTION_EXTRA_WARNINGS warns about, and we should
-    // use reportStrictModeError.  However, 'with' is the sole instance of a
+    // a subset of those that JSOPTION_STRICT warns about, and we should use
+    // reportStrictModeError.  However, 'with' is the sole instance of a
     // construct that is forbidden in strict mode code, but doesn't even merit a
-    // warning under JSOPTION_EXTRA_WARNINGS.  See
+    // warning under JSOPTION_STRICT.  See
     // https://bugzilla.mozilla.org/show_bug.cgi?id=514576#c1.
     if (pc->sc->strict && !report(ParseStrictError, true, null(), JSMSG_STRICT_CODE_WITH))
         return null();
 
     MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_BEFORE_WITH);
     Node objectExpr = parenExpr();
     if (!objectExpr)
         return null();
@@ -4566,17 +4566,17 @@ Parser<ParseHandler>::statement()
 
         StmtInfoPC stmtInfo(context);
         PushStatementPC(pc, &stmtInfo, STMT_IF);
         Node thenBranch = statement();
         if (!thenBranch)
             return null();
 
         if (handler.isEmptySemicolon(thenBranch) &&
-            !report(ParseExtraWarning, false, null(), JSMSG_EMPTY_CONSEQUENT))
+            !report(ParseStrictWarning, false, null(), JSMSG_EMPTY_CONSEQUENT))
         {
             return null();
         }
 
         Node elseBranch;
         if (tokenStream.matchToken(TOK_ELSE, TSF_OPERAND)) {
             stmtInfo.type = STMT_ELSE;
             elseBranch = statement();
--- a/js/src/frontend/SharedContext-inl.h
+++ b/js/src/frontend/SharedContext-inl.h
@@ -19,17 +19,17 @@ SharedContext::SharedContext(JSContext *
     anyCxFlags(),
     strict(strict)
 {
 }
 
 inline bool
 SharedContext::needStrictChecks()
 {
-    return context->hasExtraWarningsOption() || strict;
+    return context->hasStrictOption() || strict;
 }
 
 inline GlobalSharedContext *
 SharedContext::asGlobalSharedContext()
 {
     JS_ASSERT(isGlobalSharedContext());
     return static_cast<GlobalSharedContext*>(this);
 }
--- a/js/src/frontend/SharedContext.h
+++ b/js/src/frontend/SharedContext.h
@@ -163,17 +163,17 @@ class SharedContext
     bool hasExplicitUseStrict()        const { return anyCxFlags.hasExplicitUseStrict; }
     bool bindingsAccessedDynamically() const { return anyCxFlags.bindingsAccessedDynamically; }
     bool hasDebuggerStatement()        const { return anyCxFlags.hasDebuggerStatement; }
 
     void setExplicitUseStrict()           { anyCxFlags.hasExplicitUseStrict        = true; }
     void setBindingsAccessedDynamically() { anyCxFlags.bindingsAccessedDynamically = true; }
     void setHasDebuggerStatement()        { anyCxFlags.hasDebuggerStatement        = true; }
 
-    // JSOPTION_EXTRA_WARNINGS warnings or strict mode errors.
+    // JSOPTION_STRICT warnings or strict mode errors.
     inline bool needStrictChecks();
 };
 
 class GlobalSharedContext : public SharedContext
 {
   private:
     const RootedObject scopeChain_; /* scope chain object for the script */
 
--- a/js/src/frontend/TokenStream.cpp
+++ b/js/src/frontend/TokenStream.cpp
@@ -600,17 +600,17 @@ TokenStream::positionAfterLastFunctionKe
 bool
 TokenStream::reportStrictModeErrorNumberVA(uint32_t offset, bool strictMode, unsigned errorNumber,
                                            va_list args)
 {
     /* In strict mode code, this is an error, not merely a warning. */
     unsigned flags = JSREPORT_STRICT;
     if (strictMode)
         flags |= JSREPORT_ERROR;
-    else if (cx->hasExtraWarningsOption())
+    else if (cx->hasStrictOption())
         flags |= JSREPORT_WARNING;
     else
         return true;
 
     return reportCompileErrorNumberVA(offset, flags, errorNumber, args);
 }
 
 void
@@ -779,17 +779,17 @@ TokenStream::reportWarning(unsigned erro
                                              errorNumber, args);
     va_end(args);
     return result;
 }
 
 bool
 TokenStream::reportStrictWarningErrorNumberVA(uint32_t offset, unsigned errorNumber, va_list args)
 {
-    if (!cx->hasExtraWarningsOption())
+    if (!cx->hasStrictOption())
         return true;
 
     return reportCompileErrorNumberVA(offset, JSREPORT_STRICT|JSREPORT_WARNING, errorNumber, args);
 }
 
 void
 TokenStream::reportAsmJSError(uint32_t offset, unsigned errorNumber, ...)
 {
--- a/js/src/jit-test/tests/basic/bug823310.js
+++ b/js/src/jit-test/tests/basic/bug823310.js
@@ -1,7 +1,7 @@
 "use strict";
 options("werror");
 
 // This construct causes a strict warning, but we shouldn't get one since
-// JSOPTION_EXTRA_WARNINGS isn't enabled.
+// JSOPTION_STRICT isn't enabled.
 var x;
 eval("if (x = 3) {}");
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1901,17 +1901,17 @@ JS_StringToVersion(const char *string);
 
 /*
  * JS options are orthogonal to version, and may be freely composed with one
  * another as well as with version.
  *
  * JSOPTION_VAROBJFIX is recommended -- see the comments associated with the
  * prototypes for JS_ExecuteScript, JS_EvaluateScript, etc.
  */
-#define JSOPTION_EXTRA_WARNINGS JS_BIT(0)       /* warn on dubious practices */
+#define JSOPTION_STRICT         JS_BIT(0)       /* warn on dubious practice */
 #define JSOPTION_WERROR         JS_BIT(1)       /* convert warning to error */
 #define JSOPTION_VAROBJFIX      JS_BIT(2)       /* make JS_EvaluateScript use
                                                    the last object on its 'obj'
                                                    param's scope chain as the
                                                    ECMA 'variables object' */
 #define JSOPTION_PRIVATE_IS_NSISUPPORTS \
                                 JS_BIT(3)       /* context private data points
                                                    to an nsISupports subclass */
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -672,17 +672,17 @@ js::WouldDefinePastNonwritableLength(JSC
     }
 
     if (obj->arrayLengthIsWritable()) {
         *definesPast = false;
         return true;
     }
 
     *definesPast = true;
-    if (!strict && !cx->hasExtraWarningsOption())
+    if (!strict && !cx->hasStrictOption())
         return true;
 
     // Error in strict mode code or warn with strict option.
     // XXX include the index and maybe array length in the error message
     unsigned flags = strict ? JSREPORT_ERROR : (JSREPORT_STRICT | JSREPORT_WARNING);
     return JS_ReportErrorFlagsAndNumber(cx, flags, js_GetErrorMessage, NULL,
                                         JSMSG_CANT_DEFINE_PAST_ARRAY_LENGTH);
 }
--- a/js/src/jscntxt.cpp
+++ b/js/src/jscntxt.cpp
@@ -535,30 +535,30 @@ js_ReportAllocationOverflow(JSContext *m
  * true if we should continue normally, without reporting anything;
  * otherwise, adjust *flags as appropriate and return false.
  */
 static bool
 checkReportFlags(JSContext *cx, unsigned *flags)
 {
     if (JSREPORT_IS_STRICT_MODE_ERROR(*flags)) {
         /*
-         * Error in strict code; warning with extra warnings option; okay
-         * otherwise.  We assume that if the top frame is a native, then it is
-         * strict if the nearest scripted frame is strict, see bug 536306.
+         * Error in strict code; warning with strict option; okay otherwise.
+         * We assume that if the top frame is a native, then it is strict if
+         * the nearest scripted frame is strict, see bug 536306.
          */
         JSScript *script = cx->stack.currentScript();
         if (script && script->strict)
             *flags &= ~JSREPORT_WARNING;
-        else if (cx->hasExtraWarningsOption())
+        else if (cx->hasStrictOption())
             *flags |= JSREPORT_WARNING;
         else
             return true;
     } else if (JSREPORT_IS_STRICT(*flags)) {
         /* Warning/error only when JSOPTION_STRICT is set. */
-        if (!cx->hasExtraWarningsOption())
+        if (!cx->hasStrictOption())
             return true;
     }
 
     /* Warnings become errors when JSOPTION_WERROR is set. */
     if (JSREPORT_IS_WARNING(*flags) && cx->hasWErrorOption())
         *flags &= ~JSREPORT_WARNING;
 
     return false;
--- a/js/src/jscntxt.h
+++ b/js/src/jscntxt.h
@@ -1704,17 +1704,17 @@ struct JSContext : js::ContextFriendFiel
 
     unsigned options() const { return options_; }
 
     bool hasOption(unsigned opt) const {
         JS_ASSERT((opt & JSOPTION_MASK) == opt);
         return !!(options_ & opt);
     }
 
-    bool hasExtraWarningsOption() const { return hasOption(JSOPTION_EXTRA_WARNINGS); }
+    bool hasStrictOption() const { return hasOption(JSOPTION_STRICT); }
     bool hasWErrorOption() const { return hasOption(JSOPTION_WERROR); }
 
     js::LifoAlloc &tempLifoAlloc() { return runtime()->tempLifoAlloc; }
     inline js::LifoAlloc &analysisLifoAlloc();
     inline js::LifoAlloc &typeLifoAlloc();
 
     inline js::PropertyTree &propertyTree();
 
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -3936,18 +3936,18 @@ GetPropertyHelperInline(JSContext *cx,
             if (op == JSOP_GETXPROP) {
                 /* Undefined property during a name lookup, report an error. */
                 JSAutoByteString printable;
                 if (js_ValueToPrintable(cx, IdToValue(id), &printable))
                     js_ReportIsNotDefined(cx, printable.ptr());
                 return false;
             }
 
-            /* Don't warn if extra warnings not enabled or for random getprop operations. */
-            if (!cx->hasExtraWarningsOption() || (op != JSOP_GETPROP && op != JSOP_GETELEM))
+            /* Don't warn if not strict or for random getprop operations. */
+            if (!cx->hasStrictOption() || (op != JSOP_GETPROP && op != JSOP_GETELEM))
                 return true;
 
             /* Don't warn repeatedly for the same script. */
             if (!script || script->warnedAboutUndefinedProp)
                 return true;
 
             /* We may just be checking if that object has an iterator. */
             if (JSID_IS_ATOM(id, cx->names().iteratorIntrinsic))
@@ -4157,19 +4157,18 @@ baseops::GetPropertyDefault(JSContext *c
 static bool
 MaybeReportUndeclaredVarAssignment(JSContext *cx, JSString *propname)
 {
     {
         JSScript *script = cx->stack.currentScript(NULL, ContextStack::ALLOW_CROSS_COMPARTMENT);
         if (!script)
             return true;
 
-        // If the code is not strict and extra warnings aren't enabled, then no
-        // check is needed.
-        if (!script->strict && !cx->hasExtraWarningsOption())
+        /* If neither cx nor the code is strict, then no check is needed. */
+        if (!script->strict && !cx->hasStrictOption())
             return true;
     }
 
     JSAutoByteString bytes(cx, propname);
     return !!bytes &&
            JS_ReportErrorFlagsAndNumber(cx,
                                         (JSREPORT_WARNING | JSREPORT_STRICT
                                          | JSREPORT_STRICT_MODE_ERROR),
@@ -4181,19 +4180,18 @@ bool
 js::ReportIfUndeclaredVarAssignment(JSContext *cx, HandleString propname)
 {
     {
         jsbytecode *pc;
         JSScript *script = cx->stack.currentScript(&pc, ContextStack::ALLOW_CROSS_COMPARTMENT);
         if (!script)
             return true;
 
-        // If the code is not strict and extra warnings aren't enabled, then no
-        // check is needed.
-        if (!script->strict && !cx->hasExtraWarningsOption())
+        /* If neither cx nor the code is strict, then no check is needed. */
+        if (!script->strict && !cx->hasStrictOption())
             return true;
 
         /*
          * We only need to check for bare name mutations: we shouldn't be
          * warning, or throwing, or whatever, if we're not doing a variable
          * access.
          *
          * TryConvertToGname in frontend/BytecodeEmitter.cpp checks for rather
@@ -4285,17 +4283,17 @@ baseops::SetPropertyHelper(JSContext *cx
                     return !pd.setter ||
                            CallSetter(cx, receiver, id, pd.setter, pd.attrs, pd.shortid, strict,
                                       vp);
                 }
 
                 if (pd.attrs & JSPROP_READONLY) {
                     if (strict)
                         return JSObject::reportReadOnly(cx, id, JSREPORT_ERROR);
-                    if (cx->hasExtraWarningsOption())
+                    if (cx->hasStrictOption())
                         return JSObject::reportReadOnly(cx, id, JSREPORT_STRICT | JSREPORT_WARNING);
                     return true;
                 }
             }
 
             shape = NULL;
         }
     } else {
@@ -4329,20 +4327,20 @@ baseops::SetPropertyHelper(JSContext *cx
         /* ES5 8.12.4 [[Put]] step 2. */
         if (shape->isAccessorDescriptor()) {
             if (shape->hasDefaultSetter())
                 return js_ReportGetterOnlyAssignment(cx);
         } else {
             JS_ASSERT(shape->isDataDescriptor());
 
             if (!shape->writable()) {
-                /* Error in strict mode code, warn with extra warnings options, otherwise do nothing. */
+                /* Error in strict mode code, warn with strict option, otherwise do nothing. */
                 if (strict)
                     return JSObject::reportReadOnly(cx, id, JSREPORT_ERROR);
-                if (cx->hasExtraWarningsOption())
+                if (cx->hasStrictOption())
                     return JSObject::reportReadOnly(cx, id, JSREPORT_STRICT | JSREPORT_WARNING);
                 return JS_TRUE;
             }
         }
 
         attrs = shape->attributes();
         if (pobj != obj) {
             /*
@@ -4406,20 +4404,20 @@ baseops::SetPropertyHelper(JSContext *cx
         return true;
     }
 
     if (obj->isArray() && id == NameToId(cx->names().length))
         return ArraySetLength(cx, obj, id, attrs, vp, strict);
 
     if (!shape) {
         if (!obj->isExtensible()) {
-            /* Error in strict mode code, warn with extra warnings option, otherwise do nothing. */
+            /* Error in strict mode code, warn with strict option, otherwise do nothing. */
             if (strict)
                 return obj->reportNotExtensible(cx);
-            if (cx->hasExtraWarningsOption())
+            if (cx->hasStrictOption())
                 return obj->reportNotExtensible(cx, JSREPORT_STRICT | JSREPORT_WARNING);
             return true;
         }
 
         /* Purge the property cache of now-shadowed id in obj's scope chain. */
         if (!js_PurgeScopeChain(cx, obj, id))
             return false;
 
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -578,17 +578,17 @@ Process(JSContext *cx, JSObject *obj_, c
 /*
  * JSContext option name to flag map. The option names are in alphabetical
  * order for better reporting.
  */
 static const struct JSOption {
     const char  *name;
     uint32_t    flag;
 } js_options[] = {
-    {"strict",          JSOPTION_EXTRA_WARNINGS},
+    {"strict",          JSOPTION_STRICT},
     {"typeinfer",       JSOPTION_TYPE_INFERENCE},
     {"werror",          JSOPTION_WERROR},
     {"strict_mode",     JSOPTION_STRICT_MODE},
 };
 
 static uint32_t
 MapContextOptionNameToFlag(JSContext* cx, const char* name)
 {
@@ -4929,17 +4929,17 @@ ProcessArgs(JSContext *cx, JSObject *obj
         compileOnly = true;
 
     if (op->getBoolOption('w'))
         reportWarnings = JS_TRUE;
     else if (op->getBoolOption('W'))
         reportWarnings = JS_FALSE;
 
     if (op->getBoolOption('s'))
-        JS_ToggleOptions(cx, JSOPTION_EXTRA_WARNINGS);
+        JS_ToggleOptions(cx, JSOPTION_STRICT);
 
     if (op->getBoolOption('d')) {
         JS_SetRuntimeDebugMode(JS_GetRuntime(cx), true);
         JS_SetDebugMode(cx, true);
     }
 
     if (op->getBoolOption('b'))
         printTiming = true;
--- a/js/xpconnect/shell/xpcshell.cpp
+++ b/js/xpconnect/shell/xpcshell.cpp
@@ -693,17 +693,17 @@ GetChildGlobalObject(JSContext* cx,
 /*
  * JSContext option name to flag map. The option names are in alphabetical
  * order for better reporting.
  */
 static const struct JSOption {
     const char  *name;
     uint32_t    flag;
 } js_options[] = {
-    {"strict",          JSOPTION_EXTRA_WARNINGS},
+    {"strict",          JSOPTION_STRICT},
     {"werror",          JSOPTION_WERROR},
     {"strict_mode",     JSOPTION_STRICT_MODE},
 };
 
 static uint32_t
 MapContextOptionNameToFlag(JSContext* cx, const char* name)
 {
     for (size_t i = 0; i < ArrayLength(js_options); ++i) {
@@ -1145,17 +1145,17 @@ ProcessArgsForCompartment(JSContext *cx,
           case 'f':
           case 'e':
             if (++i == argc)
                 return;
             break;
         case 'S':
             JS_ToggleOptions(cx, JSOPTION_WERROR);
         case 's':
-            JS_ToggleOptions(cx, JSOPTION_EXTRA_WARNINGS);
+            JS_ToggleOptions(cx, JSOPTION_STRICT);
             break;
         case 'I':
             JS_ToggleOptions(cx, JSOPTION_COMPILE_N_GO);
             JS_ToggleOptions(cx, JSOPTION_ION);
             JS_ToggleOptions(cx, JSOPTION_ASMJS);
             break;
         case 'n':
             JS_ToggleOptions(cx, JSOPTION_TYPE_INFERENCE);
--- a/js/xpconnect/src/XPCComponents.cpp
+++ b/js/xpconnect/src/XPCComponents.cpp
@@ -4448,17 +4448,17 @@ SetBoolOption(JSContext* cx, uint32_t aO
         return GetBoolOption(cx, _flag, aValue);                        \
     }                                                                   \
     NS_IMETHODIMP                                                       \
     nsXPCComponents_Utils::Set## _attr(JSContext* cx, bool aValue)      \
     {                                                                   \
         return SetBoolOption(cx, _flag, aValue);                        \
     }
 
-GENERATE_JSOPTION_GETTER_SETTER(Strict, JSOPTION_EXTRA_WARNINGS)
+GENERATE_JSOPTION_GETTER_SETTER(Strict, JSOPTION_STRICT)
 GENERATE_JSOPTION_GETTER_SETTER(Werror, JSOPTION_WERROR)
 GENERATE_JSOPTION_GETTER_SETTER(Strict_mode, JSOPTION_STRICT_MODE)
 GENERATE_JSOPTION_GETTER_SETTER(Ion, JSOPTION_ION)
 
 #undef GENERATE_JSOPTION_GETTER_SETTER
 
 NS_IMETHODIMP
 nsXPCComponents_Utils::SetGCZeal(int32_t aValue, JSContext* cx)