mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
LibJS: Fix broken parsing of 0-argument CallExpression
This commit is contained in:
parent
32963cf74a
commit
9ad17d4674
Notes:
sideshowbarker
2024-07-19 08:20:20 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9ad17d46742
1 changed files with 5 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue