mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-01 21:59:07 +00:00
LibJS: Restructure and fully implement BindingPatterns
This commit is contained in:
parent
10372b8118
commit
ce04c2259f
Notes:
sideshowbarker
2024-07-18 12:02:44 +09:00
Author: https://github.com/mattco98
Commit: ce04c2259f
Pull-request: https://github.com/SerenityOS/serenity/pull/8033
Reviewed-by: https://github.com/alimpfard
Reviewed-by: https://github.com/awesomekling
9 changed files with 244 additions and 169 deletions
|
@ -100,7 +100,7 @@ LexicalEnvironment* ScriptFunction::create_environment()
|
|||
parameter.binding.visit(
|
||||
[&](const FlyString& name) { variables.set(name, { js_undefined(), DeclarationKind::Var }); },
|
||||
[&](const NonnullRefPtr<BindingPattern>& binding) {
|
||||
binding->for_each_assigned_name([&](const auto& name) {
|
||||
binding->for_each_bound_name([&](const auto& name) {
|
||||
variables.set(name, { js_undefined(), DeclarationKind::Var });
|
||||
});
|
||||
});
|
||||
|
@ -114,7 +114,7 @@ LexicalEnvironment* ScriptFunction::create_environment()
|
|||
variables.set(id->string(), { js_undefined(), declaration.declaration_kind() });
|
||||
},
|
||||
[&](const NonnullRefPtr<BindingPattern>& binding) {
|
||||
binding->for_each_assigned_name([&](const auto& name) {
|
||||
binding->for_each_bound_name([&](const auto& name) {
|
||||
variables.set(name, { js_undefined(), declaration.declaration_kind() });
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue