From 8a260ca5389312f4c1170a79048a19443f9f5dcd Mon Sep 17 00:00:00 2001 From: Ted Campbell Date: Wed, 19 Jun 2019 00:27:41 +0000 Subject: [PATCH] Bug 1559275 - Remove unused CompileOptions::allowSyntaxParser. r=jandem Differential Revision: https://phabricator.services.mozilla.com/D35070 --HG-- extra : moz-landing-system : lando --- js/public/CompileOptions.h | 6 ------ js/src/shell/js.cpp | 21 +-------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/js/public/CompileOptions.h b/js/public/CompileOptions.h index 73869ab09162..2b63834896e6 100644 --- a/js/public/CompileOptions.h +++ b/js/public/CompileOptions.h @@ -193,7 +193,6 @@ class JS_PUBLIC_API ReadOnlyCompileOptions : public TransitiveCompileOptions { bool nonSyntacticScope = false; bool noScriptRval = false; - bool allowSyntaxParser = true; private: friend class CompileOptions; @@ -405,11 +404,6 @@ class MOZ_STACK_CLASS JS_PUBLIC_API CompileOptions final return *this; } - CompileOptions& setAllowSyntaxParser(bool clp) { - allowSyntaxParser = clp; - return *this; - } - CompileOptions& setSourceIsLazy(bool l) { sourceIsLazy = l; return *this; diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp index 665f37a5e7e5..a0b56312fdab 100644 --- a/js/src/shell/js.cpp +++ b/js/src/shell/js.cpp @@ -5174,7 +5174,6 @@ static bool Parse(JSContext* cx, unsigned argc, Value* vp) { return false; } - bool allowSyntaxParser = true; frontend::ParseGoal goal = frontend::ParseGoal::Script; if (args.length() >= 2) { @@ -5186,22 +5185,6 @@ static bool Parse(JSContext* cx, unsigned argc, Value* vp) { } RootedObject objOptions(cx, &args[1].toObject()); - RootedValue optionAllowSyntaxParser(cx); - if (!JS_GetProperty(cx, objOptions, "allowSyntaxParser", - &optionAllowSyntaxParser)) { - return false; - } - - if (optionAllowSyntaxParser.isBoolean()) { - allowSyntaxParser = optionAllowSyntaxParser.toBoolean(); - } else if (!optionAllowSyntaxParser.isUndefined()) { - const char* typeName = InformalValueTypeName(optionAllowSyntaxParser); - JS_ReportErrorASCII( - cx, "option `allowSyntaxParser` should be a boolean, got %s", - typeName); - return false; - } - RootedValue optionModule(cx); if (!JS_GetProperty(cx, objOptions, "module", &optionModule)) { return false; @@ -5233,9 +5216,7 @@ static bool Parse(JSContext* cx, unsigned argc, Value* vp) { const char16_t* chars = stableChars.twoByteRange().begin().get(); CompileOptions options(cx); - options.setIntroductionType("js shell parse") - .setFileAndLine("", 1) - .setAllowSyntaxParser(allowSyntaxParser); + options.setIntroductionType("js shell parse").setFileAndLine("", 1); if (goal == frontend::ParseGoal::Module) { // See frontend::CompileModule. options.maybeMakeStrictMode(true);