LibJS: Fix broken parsing of 0-argument CallExpression

This commit is contained in:
Andreas Kling 2020-03-12 20:03:12 +01:00
commit 9ad17d4674
Notes: sideshowbarker 2024-07-19 08:20:20 +09:00

View file

@ -195,13 +195,11 @@ NonnullOwnPtr<CallExpression> Parser::parse_call_expression(NonnullOwnPtr<Expres
NonnullOwnPtrVector<Expression> arguments; NonnullOwnPtrVector<Expression> arguments;
for (;;) { while (match_expression()) {
if (match_expression()) { arguments.append(parse_expression());
arguments.append(parse_expression()); if (!match(TokenType::Comma))
if (!match(TokenType::Comma)) break;
break; consume();
consume();
}
} }
consume(TokenType::ParenClose); consume(TokenType::ParenClose);