diff options
author | Martok <martok@martoks-place.de> | 2022-06-17 21:00:15 +0200 |
---|---|---|
committer | Martok <martok@martoks-place.de> | 2022-06-17 21:00:15 +0200 |
commit | 5d0bc8e811c9a4fb206dbda9667e07c970fd0a26 (patch) | |
tree | 612a4026a6b5835350d41a1ef382a2b71038716d | |
parent | a90b552eb4ca9550a7b2aab58a6fcf66b1f740d8 (diff) | |
download | uxp-5d0bc8e811c9a4fb206dbda9667e07c970fd0a26.tar.gz |
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
-rw-r--r-- | js/src/frontend/Parser.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp index 15c3448013..1969628f38 100644 --- a/js/src/frontend/Parser.cpp +++ b/js/src/frontend/Parser.cpp @@ -9743,13 +9743,14 @@ Parser<ParseHandler>::propertyName(YieldHandling yieldHandling, // ComputedPropertyName[Yield, Await]: // [ ... TokenKind tt = TOK_EOF; - if (!tokenStream.getToken(&tt)) + if (!tokenStream.peekTokenSameLine(&tt)) 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; + tokenStream.consumeKnownToken(tt); ltok = tt; - } else { - tokenStream.ungetToken(); } } |