diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 7c8df7d498..a088949c8b 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -7491,11 +7491,6 @@ Parser::classMember(YieldHandling yieldHandling, return false; if (propType == PropertyType::Field) { - if (!options().fieldsEnabledOption) { - errorAt(propNameOffset, JSMSG_FIELDS_NOT_SUPPORTED); - return false; - } - if (isStatic) { if (propAtom == context->names().prototype) { errorAt(propNameOffset, JSMSG_BAD_METHOD_DEF); diff --git a/js/src/frontend/TokenStream.cpp b/js/src/frontend/TokenStream.cpp index 2c3371b465..f11fdcd793 100644 --- a/js/src/frontend/TokenStream.cpp +++ b/js/src/frontend/TokenStream.cpp @@ -1545,11 +1545,6 @@ TokenStream::getTokenInternal(TokenKind* ttp, Modifier modifier) if (identVisibility == NameVisibility::Private) { MOZ_ASSERT(identStart[0] == '#', "Private identifier starts with #"); tp->type = TOK_PRIVATE_NAME; - - if (!options().fieldsEnabledOption) { - reportError(JSMSG_FIELDS_NOT_SUPPORTED); - goto error; - } } else { tp->type = TOK_NAME; } diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp index 6b2a719d7e..c0fa85bc68 100644 --- a/js/src/jsapi.cpp +++ b/js/src/jsapi.cpp @@ -3873,7 +3873,6 @@ JS::TransitiveCompileOptions::copyPODTransitiveOptions(const TransitiveCompileOp forceAsync = rhs.forceAsync; installedFile = rhs.installedFile; sourceIsLazy = rhs.sourceIsLazy; - fieldsEnabledOption = rhs.fieldsEnabledOption; introductionType = rhs.introductionType; introductionLineno = rhs.introductionLineno; introductionOffset = rhs.introductionOffset; diff --git a/js/src/jsapi.h b/js/src/jsapi.h index 4640ab0b50..a6a5429cf5 100644 --- a/js/src/jsapi.h +++ b/js/src/jsapi.h @@ -3820,7 +3820,6 @@ class JS_FRIEND_API(TransitiveCompileOptions) forceAsync(false), installedFile(false), sourceIsLazy(false), - fieldsEnabledOption(true), introductionType(nullptr), introductionLineno(0), introductionOffset(0), @@ -3856,7 +3855,6 @@ class JS_FRIEND_API(TransitiveCompileOptions) bool forceAsync; bool installedFile; // 'true' iff pre-compiling js file in packaged app bool sourceIsLazy; - bool fieldsEnabledOption; // |introductionType| is a statically allocated C string: // one of "eval", "Function", or "GeneratorFunction".