mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-24 16:17:29 +09:00
Issue #2173 - Introduce FunctionNode::syntaxKind instead of JSOPs
This moves some "implementation details" to later in the emitter,
and also keeps syntax information available for later use.
Based-on: 1518391/{3+4}
This commit is contained in:
parent
0dac791851
commit
0132ae2101
6 changed files with 138 additions and 133 deletions
|
|
@ -7044,7 +7044,8 @@ ParseFunction(ModuleValidator& m, FunctionNode** funNodeOut, unsigned* line)
|
|||
if (!name)
|
||||
return false;
|
||||
|
||||
FunctionNode* funNode = m.parser().handler.newFunctionStatement();
|
||||
FunctionSyntaxKind syntaxKind = FunctionSyntaxKind::Statement;
|
||||
FunctionNode* funNode = m.parser().handler.newFunction(syntaxKind);
|
||||
if (!funNode)
|
||||
return false;
|
||||
|
||||
|
|
@ -7058,14 +7059,14 @@ ParseFunction(ModuleValidator& m, FunctionNode** funNodeOut, unsigned* line)
|
|||
SyncFunction, /* tryAnnexB = */ false);
|
||||
if (!funbox)
|
||||
return false;
|
||||
funbox->initWithEnclosingParseContext(outerpc, frontend::Statement);
|
||||
funbox->initWithEnclosingParseContext(outerpc, syntaxKind);
|
||||
|
||||
Directives newDirectives = directives;
|
||||
ParseContext funpc(&m.parser(), funbox, &newDirectives);
|
||||
if (!funpc.init())
|
||||
return false;
|
||||
|
||||
if (!m.parser().functionFormalParametersAndBody(InAllowed, YieldIsName, funNode, Statement)) {
|
||||
if (!m.parser().functionFormalParametersAndBody(InAllowed, YieldIsName, funNode, syntaxKind)) {
|
||||
if (tokenStream.hadError() || directives == newDirectives)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue