Issue #2236 - Fix import.meta module error in lambdas by moving parseGoal() into SharedContext. Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1604792 Also remove ParseGoal being passed through Parser introduced in #1691 Part 2.

This commit is contained in:
Brian Smith 2023-05-08 18:28:18 -05:00 • committed by roytam1
commit 1c70f64e7c
10 changed files with 63 additions and 45 deletions

View file

@ -4342,8 +4342,7 @@ Parse(JSContext* cx, unsigned argc, Value* vp)
if (!usedNames.init())
return false;
Parser<FullParseHandler> parser(cx, cx->tempLifoAlloc(), options, chars, length,
/* foldConstants = */ true, usedNames, nullptr, nullptr,
ParseGoal::Script);
/* foldConstants = */ true, usedNames, nullptr, nullptr);
if (!parser.checkOptions())
return false;
@ -4394,8 +4393,7 @@ SyntaxParse(JSContext* cx, unsigned argc, Value* vp)
return false;
Parser<frontend::SyntaxParseHandler> parser(cx, cx->tempLifoAlloc(),
options, chars, length, false,
usedNames, nullptr, nullptr,
ParseGoal::Script);
usedNames, nullptr, nullptr);
if (!parser.checkOptions())
return false;