diff options
author | Linus Groh <mail@linusgroh.de> | 2020-04-07 18:29:37 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-04-07 21:26:38 +0200 |
commit | 3e677fd03d012020cdaa9c9bdfa9a5534486d743 (patch) | |
tree | 24f99fb1016c9df2c8b0441090328e09f164686b /Libraries/LibJS | |
parent | 19be842b5b0f0a15cd5adfb1e1020391d48f7bf1 (diff) | |
download | serenity-3e677fd03d012020cdaa9c9bdfa9a5534486d743.zip |
LibJS: Break loop on EOF when parsing object expression
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r-- | Libraries/LibJS/Parser.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibJS/Parser.cpp b/Libraries/LibJS/Parser.cpp index 65916686cd..408f573e8d 100644 --- a/Libraries/LibJS/Parser.cpp +++ b/Libraries/LibJS/Parser.cpp @@ -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(); |