Issue #1918 - m-c 1345960: Handle shorthand property and destructuring with async keyword properly.

This was previously partially present, but got lost along the way
This commit is contained in:
Martok 2022-06-17 21:00:15 +02:00 • committed by roytam1
commit 8b14220c3c

View file

@ -9743,13 +9743,14 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling,
// ComputedPropertyName[Yield, Await]: // ComputedPropertyName[Yield, Await]:
// [ ... // [ ...
TokenKind tt = TOK_EOF; TokenKind tt = TOK_EOF;
if (!tokenStream.getToken(&tt)) if (!tokenStream.peekTokenSameLine(&tt))
return null(); return null();
if (tt != TOK_LP && tt != TOK_COLON && tt != TOK_RC && tt != TOK_ASSIGN) { if (tt == TOK_STRING || tt == TOK_NUMBER || tt == TOK_LB ||
TokenKindIsPossibleIdentifierName(tt))
{
isAsync = true; isAsync = true;
tokenStream.consumeKnownToken(tt);
ltok = tt; ltok = tt;
} else {
tokenStream.ungetToken();
} }
} }