summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Parser.cpp
diff options
context:
space:
mode:
authorAli Mohammad Pur <ali.mpfard@gmail.com>2021-07-02 14:55:53 +0430
committerAndreas Kling <kling@serenityos.org>2021-07-02 14:59:03 +0200
commita6fe27423a1b98c157f98ccba7f989eea0105547 (patch)
tree3eb9290df96880ba38b0870904c7c27759fccfb9 /Userland/Libraries/LibJS/Parser.cpp
parentbd9f28bba694b7b015454fc486e43cd78b5418cf (diff)
downloadserenity-a6fe27423a1b98c157f98ccba7f989eea0105547.zip
LibJS: Allow binding patterns as for in/of targets
Diffstat (limited to 'Userland/Libraries/LibJS/Parser.cpp')
-rw-r--r--Userland/Libraries/LibJS/Parser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp
index b423529c68..93e110f83e 100644
--- a/Userland/Libraries/LibJS/Parser.cpp
+++ b/Userland/Libraries/LibJS/Parser.cpp
@@ -1701,7 +1701,7 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(bool for_l
init = parse_expression(2);
} else if (!for_loop_variable_declaration && declaration_kind == DeclarationKind::Const) {
syntax_error("Missing initializer in 'const' variable declaration");
- } else if (target.has<NonnullRefPtr<BindingPattern>>()) {
+ } else if (!for_loop_variable_declaration && target.has<NonnullRefPtr<BindingPattern>>()) {
syntax_error("Missing initializer in destructuring assignment");
}