mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-14 10:20:36 +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: https://github.com/SerenityOS/serenity/commit/3e677fd03d0 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;
|
||||
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 a new issue