636635 - Do not create named lambda binding for a function created by Function constructor.

This commit is contained in:
Gaming4JC 2019-06-08 15:03:53 -04:00 • committed by Roy Tam
commit 7f7b0a029c
5 changed files with 85 additions and 13 deletions

View file

@ -1070,7 +1070,8 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
// ParseContext is already on the stack.
bool functionFormalParametersAndBody(InHandling inHandling, YieldHandling yieldHandling,
Node pn, FunctionSyntaxKind kind,
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing());
mozilla::Maybe<uint32_t> parameterListEnd = mozilla::Nothing(),
bool isStandaloneFunction = false);
// Determine whether |yield| is a valid name in the current context, or
@ -1350,8 +1351,8 @@ class Parser final : private JS::AutoGCRooter, public StrictModeGetter
GeneratorKind generatorKind, FunctionAsyncKind asyncKind,
bool tryAnnexB,
Directives inheritedDirectives, Directives* newDirectives);
bool finishFunctionScopes();
bool finishFunction();
bool finishFunctionScopes(bool isStandaloneFunction);
bool finishFunction(bool isStandaloneFunction = false);
bool leaveInnerFunction(ParseContext* outerpc);
bool matchOrInsertSemicolonHelper(TokenStream::Modifier modifier);