Move the Parser::checkFunctionDefinition call into its callers.

This commit is contained in:
wolfbeast 2019-04-06 06:22:55 +02:00 • committed by Roy Tam
commit da1cb60dc3
6 changed files with 116 additions and 95 deletions

View file

@ -1262,7 +1262,8 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
Node functionDefinition(uint32_t preludeStart, Node pn,
InHandling inHandling, YieldHandling yieldHandling, HandleAtom name,
FunctionSyntaxKind kind,
GeneratorKind generatorKind, FunctionAsyncKind asyncKind);
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
bool tryAnnexB = false);
// Parse a function body. Pass StatementListBody if the body is a list of
// statements; pass ExpressionBody if the body is a single expression.
@ -1348,7 +1349,7 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
Node newDotGeneratorName();
bool declareDotGeneratorName();
bool checkFunctionDefinition(HandleAtom funAtom, Node pn, FunctionSyntaxKind kind,
bool checkFunctionDefinition(HandlePropertyName funName, Node pn,
GeneratorKind generatorKind, bool* tryAnnexB);
bool skipLazyInnerFunction(Node pn, uint32_t preludeStart, FunctionSyntaxKind kind,
bool tryAnnexB);