mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibJS: Allow binding patterns as for in/of targets
This commit is contained in:
parent
bd9f28bba6
commit
a6fe27423a
Notes:
sideshowbarker
2024-07-18 11:07:37 +09:00
Author: https://github.com/alimpfard
Commit: a6fe27423a
Pull-request: https://github.com/SerenityOS/serenity/pull/8384
3 changed files with 9 additions and 1 deletions
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue