1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibJS: Fix broken parsing of 0-argument CallExpression

This commit is contained in:
Andreas Kling 2020-03-12 20:03:12 +01:00
parent 32963cf74a
commit 9ad17d4674

View file

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