Bug 1604792 - Move parseGoal from Parser to SharedContext. r=mgaudet

Since this flag is preserved on LazyScript, it is useful to track it on
SharedContext and initialize it consistently on lazy and non-lazy scripts.
This patch removes the plumbing of passing the ParseGoal through the parser
class hierarchy.

Differential Revision: https://phabricator.services.mozilla.com/D57661
This commit is contained in:
Ted Campbell
2019-12-18 22:14:34 +00:00
parent 260f5075bc
commit f7b1181751
14 changed files with 62 additions and 61 deletions

View File

@@ -367,11 +367,11 @@ JS::Result<Ok> BinASTParserPerTokenizer<Tok>::finishLazyFunction(
funbox->setArgCount(nargs);
funbox->synchronizeArgCount();
BINJS_TRY_DECL(lazy,
LazyScript::Create(
cx_, fun, sourceObject_, pc_->closedOverBindingsForLazy(),
pc_->innerFunctionBoxesForLazy, start, end, start, end,
/* lineno = */ 0, start, ParseGoal::Script));
BINJS_TRY_DECL(lazy, LazyScript::Create(cx_, fun, sourceObject_,
pc_->closedOverBindingsForLazy(),
pc_->innerFunctionBoxesForLazy, start,
end, start, end,
/* lineno = */ 0, start));
if (funbox->strict()) {
lazy->setStrict();