Bug 1552316 - Don't rely on functionbox for initFromLazyFunction r=tcampbell

Differential Revision: https://phabricator.services.mozilla.com/D31536

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Gaudet 2019-05-21 13:47:44 +00:00
parent 4fc4833da6
commit 32b04894a8
4 changed files with 4 additions and 5 deletions

View File

@ -277,7 +277,7 @@ JS::Result<FunctionBox*> BinASTParserPerTokenizer<Tok>::buildFunctionBox(
if (pc_) {
funbox->initWithEnclosingParseContext(pc_, fun,syntax);
} else {
funbox->initFromLazyFunction();
funbox->initFromLazyFunction(fun);
}
return funbox;
}

View File

@ -2871,7 +2871,7 @@ FunctionNode* Parser<FullParseHandler, Unit>::standaloneLazyFunction(
if (!funbox) {
return null();
}
funbox->initFromLazyFunction();
funbox->initFromLazyFunction(fun);
Directives newDirectives = directives;
SourceParseContext funpc(this, funbox, &newDirectives);

View File

@ -171,8 +171,7 @@ FunctionBox::FunctionBox(JSContext* cx, TraceListNode* traceListHead,
MOZ_ASSERT(fun->isTenured());
}
void FunctionBox::initFromLazyFunction() {
JSFunction* fun = function();
void FunctionBox::initFromLazyFunction(JSFunction* fun) {
if (fun->lazyScript()->isDerivedClassConstructor()) {
setDerivedClassConstructor();
}

View File

@ -431,7 +431,7 @@ class FunctionBox : public ObjectBox, public SharedContext {
&extraVarScopeBindings_);
}
void initFromLazyFunction();
void initFromLazyFunction(JSFunction* fun);
void initStandaloneFunction(Scope* enclosingScope);
void initWithEnclosingParseContext(ParseContext* enclosing, JSFunction* fun,
FunctionSyntaxKind kind);