mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 08:36:15 +00:00
LibJS: Fix broken parsing of 0-argument CallExpression
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user