mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03: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: https://github.com/SerenityOS/serenity/commit/3e677fd03d0 Pull-request: https://github.com/SerenityOS/serenity/pull/1688
@ -388,7 +388,7 @@ NonnullRefPtr<ObjectExpression> Parser::parse_object_expression()
|
||||
HashMap<FlyString, NonnullRefPtr<Expression>> properties;
|
||||
consume(TokenType::CurlyOpen);
|
||||
|
||||
while (!match(TokenType::CurlyClose)) {
|
||||
while (!done() && !match(TokenType::CurlyClose)) {
|
||||
FlyString property_name;
|
||||
if (match(TokenType::Identifier)) {
|
||||
property_name = consume(TokenType::Identifier).value();
|
||||
|
Loading…
Reference in New Issue
Block a user