Bug 1083458 - Remove expression closure warning. r=jandem
authorTom Schuster <evilpies@gmail.com>
Sun, 01 Apr 2018 18:27:39 +0200
changeset 776622 7d7010443cce082bdd0ddc7db0f0d5c78a1d3f5e
parent 776621 563a04e747336ddccebcb7f780a913abc739d9b5
child 776623 6ad039952ae647a8d01167c6d1ca35883e96a477
child 777207 50e678c4c9c67106b496a0bcf8ef4effaa767a0b
child 777582 5c33f60e0e4c8e38d3f79d1514bbdd6be7c00bcc
push id104926
push userbmo:jlaster@mozilla.com
push dateTue, 03 Apr 2018 13:48:15 +0000
reviewersjandem
bugs1083458
milestone61.0a1
Bug 1083458 - Remove expression closure warning. r=jandem
js/src/frontend/Parser.cpp
js/src/frontend/Parser.h
js/src/js.msg
js/src/vm/JSCompartment.cpp
js/src/vm/JSCompartment.h
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -10050,33 +10050,16 @@ GeneralParser<ParseHandler, CharT>::expr
 void
 ParserBase::addTelemetry(DeprecatedLanguageExtension e)
 {
     if (context->helperThread())
         return;
     context->compartment()->addTelemetry(getFilename(), e);
 }
 
-template <class ParseHandler, typename CharT>
-bool
-GeneralParser<ParseHandler, CharT>::warnOnceAboutExprClosure()
-{
-#ifndef RELEASE_OR_BETA
-    if (context->helperThread())
-        return true;
-
-    if (!context->compartment()->warnedAboutExprClosure) {
-        if (!warning(JSMSG_DEPRECATED_EXPR_CLOSURE))
-            return false;
-        context->compartment()->warnedAboutExprClosure = true;
-    }
-#endif
-    return true;
-}
-
 template class PerHandlerParser<FullParseHandler>;
 template class PerHandlerParser<SyntaxParseHandler>;
 template class GeneralParser<FullParseHandler, char16_t>;
 template class GeneralParser<SyntaxParseHandler, char16_t>;
 template class Parser<FullParseHandler, char16_t>;
 template class Parser<SyntaxParseHandler, char16_t>;
 
 } /* namespace frontend */
--- a/js/src/frontend/Parser.h
+++ b/js/src/frontend/Parser.h
@@ -908,18 +908,16 @@ class GeneralParser
     MOZ_MUST_USE bool strictModeErrorAt(uint32_t offset, unsigned errorNumber, ...);
 
     /* Report the given warning at the current offset. */
     MOZ_MUST_USE bool warning(unsigned errorNumber, ...);
 
     /* Report the given warning at the given offset. */
     MOZ_MUST_USE bool warningAt(uint32_t offset, unsigned errorNumber, ...);
 
-    bool warnOnceAboutExprClosure();
-
     /*
      * If extra warnings are enabled, report the given warning at the current
      * offset.
      */
     MOZ_MUST_USE bool extraWarning(unsigned errorNumber, ...);
 
     /*
      * If extra warnings are enabled, report the given warning at the given
--- a/js/src/js.msg
+++ b/js/src/js.msg
@@ -237,21 +237,18 @@ MSG_DEF(JSMSG_CURLY_BEFORE_CATCH,      0
 MSG_DEF(JSMSG_CURLY_BEFORE_CLASS,      0, JSEXN_SYNTAXERR, "missing { before class body")
 MSG_DEF(JSMSG_CURLY_BEFORE_FINALLY,    0, JSEXN_SYNTAXERR, "missing { before finally block")
 MSG_DEF(JSMSG_CURLY_BEFORE_SWITCH,     0, JSEXN_SYNTAXERR, "missing { before switch body")
 MSG_DEF(JSMSG_CURLY_BEFORE_TRY,        0, JSEXN_SYNTAXERR, "missing { before try block")
 MSG_DEF(JSMSG_CURLY_IN_COMPOUND,       0, JSEXN_SYNTAXERR, "missing } in compound statement")
 MSG_DEF(JSMSG_DECLARATION_AFTER_EXPORT,0, JSEXN_SYNTAXERR, "missing declaration after 'export' keyword")
 MSG_DEF(JSMSG_DECLARATION_AFTER_IMPORT,0, JSEXN_SYNTAXERR, "missing declaration after 'import' keyword")
 MSG_DEF(JSMSG_DEPRECATED_DELETE_OPERAND, 0, JSEXN_SYNTAXERR, "applying the 'delete' operator to an unqualified name is deprecated")
-MSG_DEF(JSMSG_DEPRECATED_EXPR_CLOSURE, 0, JSEXN_WARN, "expression closures are deprecated")
-MSG_DEF(JSMSG_DEPRECATED_FOR_EACH,     0, JSEXN_WARN, "JavaScript 1.6's for-each-in loops are deprecated; consider using ES6 for-of instead")
 MSG_DEF(JSMSG_DEPRECATED_OCTAL,        0, JSEXN_SYNTAXERR, "\"0\"-prefixed octal literals and octal escape sequences are deprecated; for octal literals use the \"0o\" prefix instead")
 MSG_DEF(JSMSG_DEPRECATED_PRAGMA,       1, JSEXN_WARN, "Using //@ to indicate {0} pragmas is deprecated. Use //# instead")
-MSG_DEF(JSMSG_DEPRECATED_BLOCK_SCOPE_FUN_REDECL, 1, JSEXN_WARN, "redeclaration of block-scoped function `{0}' is deprecated")
 MSG_DEF(JSMSG_DUPLICATE_EXPORT_NAME,   1, JSEXN_SYNTAXERR, "duplicate export name '{0}'")
 MSG_DEF(JSMSG_DUPLICATE_FORMAL,        1, JSEXN_SYNTAXERR, "duplicate formal argument {0}")
 MSG_DEF(JSMSG_DUPLICATE_LABEL,         0, JSEXN_SYNTAXERR, "duplicate label")
 MSG_DEF(JSMSG_DUPLICATE_PROPERTY,      1, JSEXN_SYNTAXERR, "property name {0} appears more than once in object literal")
 MSG_DEF(JSMSG_DUPLICATE_PROTO_PROPERTY, 0, JSEXN_SYNTAXERR, "property name __proto__ appears more than once in object literal")
 MSG_DEF(JSMSG_EMPTY_CONSEQUENT,        0, JSEXN_SYNTAXERR, "mistyped ; after conditional?")
 MSG_DEF(JSMSG_EQUAL_AS_ASSIGN,         0, JSEXN_SYNTAXERR, "test for equality (==) mistyped as assignment (=)?")
 MSG_DEF(JSMSG_EXPORT_DECL_AT_TOP_LEVEL,0, JSEXN_SYNTAXERR, "export declarations may only appear at top level of a module")
--- a/js/src/vm/JSCompartment.cpp
+++ b/js/src/vm/JSCompartment.cpp
@@ -46,17 +46,16 @@ JSCompartment::JSCompartment(Zone* zone,
     behaviors_(options.behaviors()),
     zone_(zone),
     runtime_(zone->runtimeFromAnyThread()),
     principals_(nullptr),
     isSystem_(false),
     isAtomsCompartment_(false),
     isSelfHosting(false),
     marked(true),
-    warnedAboutExprClosure(false),
     warnedAboutStringGenericsMethods(0),
 #ifdef DEBUG
     firedOnNewGlobalObject(false),
 #endif
     global_(nullptr),
     enterCompartmentDepth(0),
     performanceMonitoring(runtime_),
     data(nullptr),
--- a/js/src/vm/JSCompartment.h
+++ b/js/src/vm/JSCompartment.h
@@ -614,17 +614,16 @@ struct JSCompartment
   private:
     JSPrincipals*                principals_;
     bool                         isSystem_;
     bool                         isAtomsCompartment_;
 
   public:
     bool                         isSelfHosting;
     bool                         marked;
-    bool                         warnedAboutExprClosure : 1;
     uint32_t                     warnedAboutStringGenericsMethods;
 
 #ifdef DEBUG
     bool                         firedOnNewGlobalObject;
 #endif
 
     void mark() { marked = true; }