Bug 1552316 - Use FunctionBox in ModuleBuilder r=tcampbell

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matthew Gaudet 2019-05-21 13:45:36 +00:00
parent 35b6b4f5f2
commit 14adfcb8f2

View File

@ -1397,9 +1397,9 @@ bool ModuleBuilder::processExport(frontend::ParseNode* exportNode) {
}
case ParseNodeKind::Function: {
RootedFunction func(cx_, kid->as<FunctionNode>().funbox()->function());
MOZ_ASSERT(!func->isArrow());
RootedAtom localName(cx_, func->explicitName());
FunctionBox* box = kid->as<FunctionNode>().funbox();
MOZ_ASSERT(!box->isArrow());
RootedAtom localName(cx_, box->explicitName());
RootedAtom exportName(
cx_, isDefault ? cx_->names().default_ : localName.get());
MOZ_ASSERT_IF(isDefault, localName);