summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2020-04-07 18:29:37 +0100
committerAndreas Kling <kling@serenityos.org>2020-04-07 21:26:38 +0200
commit3e677fd03d012020cdaa9c9bdfa9a5534486d743 (patch)
tree24f99fb1016c9df2c8b0441090328e09f164686b /Libraries/LibJS
parent19be842b5b0f0a15cd5adfb1e1020391d48f7bf1 (diff)
downloadserenity-3e677fd03d012020cdaa9c9bdfa9a5534486d743.zip
LibJS: Break loop on EOF when parsing object expression
Diffstat (limited to 'Libraries/LibJS')
-rw-r--r--Libraries/LibJS/Parser.cpp2
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();