diff options
-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(); } } |