1336783 - Part 1: Rework on reserved word and remove TokenStream::KeywordIsName.

This commit is contained in:
Gaming4JC 2019-06-09 16:14:01 -04:00 • committed by Roy Tam
commit c1f6b0ff36
15 changed files with 851 additions and 722 deletions

View file

@ -7057,7 +7057,7 @@ ParseFunction(ModuleValidator& m, ParseNode** fnOut, unsigned* line)
TokenKind tk;
if (!tokenStream.getToken(&tk, TokenStream::Operand))
return false;
if (tk != TOK_NAME && tk != TOK_YIELD)
if (!TokenKindIsPossibleIdentifier(tk))
return false; // The regular parser will throw a SyntaxError, no need to m.fail.
RootedPropertyName name(m.cx(), m.parser().bindingIdentifier(YieldIsName));