Bug 1597152 - Part 1: Set lazy function position after reading tree. r=Yoric

Differential Revision: https://phabricator.services.mozilla.com/D53368
This commit is contained in:
Tooru Fujisawa
2019-11-22 14:19:29 +00:00
parent 86aae9488d
commit 53a9e4e438
5 changed files with 108 additions and 2 deletions

View File

@@ -137,6 +137,8 @@ JS::Result<ParseNode*> BinASTParserPerTokenizer<Tok>::parseAux(
const auto topContext = RootContext();
MOZ_TRY_VAR(result, asFinalParser()->parseProgram(topContext));
MOZ_TRY(tokenizer_->readTreeFooter());
mozilla::Maybe<GlobalScope::Data*> bindings =
NewGlobalScopeData(cx_, varScope, alloc_, pc_);
if (MOZ_UNLIKELY(!bindings)) {
@@ -376,6 +378,8 @@ JS::Result<Ok> BinASTParserPerTokenizer<Tok>::finishLazyFunction(
MOZ_ASSERT(lazy->isBinAST());
funbox->initLazyScript(lazy);
MOZ_TRY(tokenizer_->registerLazyScript(lazy));
return Ok();
}