mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +00:00
LibJS: Break loop on EOF when parsing object expression
This commit is contained in:
parent
19be842b5b
commit
3e677fd03d
Notes:
sideshowbarker
2024-07-19 07:49:45 +09:00
Author: https://github.com/linusg
Commit: 3e677fd03d
Pull-request: https://github.com/SerenityOS/serenity/pull/1688
1 changed files with 1 additions and 1 deletions
|
@ -388,7 +388,7 @@ NonnullRefPtr<ObjectExpression> Parser::parse_object_expression()
|
||||||
HashMap<FlyString, NonnullRefPtr<Expression>> properties;
|
HashMap<FlyString, NonnullRefPtr<Expression>> properties;
|
||||||
consume(TokenType::CurlyOpen);
|
consume(TokenType::CurlyOpen);
|
||||||
|
|
||||||
while (!match(TokenType::CurlyClose)) {
|
while (!done() && !match(TokenType::CurlyClose)) {
|
||||||
FlyString property_name;
|
FlyString property_name;
|
||||||
if (match(TokenType::Identifier)) {
|
if (match(TokenType::Identifier)) {
|
||||||
property_name = consume(TokenType::Identifier).value();
|
property_name = consume(TokenType::Identifier).value();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue