diff options
author | Matthew Olsson <matthewcolsson@gmail.com> | 2021-06-12 18:04:28 -0700 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-19 09:38:26 +0200 |
commit | ce04c2259f78341667a5a94d1e5b9725167047e2 (patch) | |
tree | 50abde87bd1eb1fa68dc783f5bdda7a758749f94 /Userland/Libraries/LibJS/Bytecode | |
parent | 10372b81184b00aea37d497efd13345232170cef (diff) | |
download | serenity-ce04c2259f78341667a5a94d1e5b9725167047e2.zip |
LibJS: Restructure and fully implement BindingPatterns
Diffstat (limited to 'Userland/Libraries/LibJS/Bytecode')
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 9fcdcb1fbd..022f11ea87 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -43,7 +43,7 @@ void ScopeNode::generate_bytecode(Bytecode::Generator& generator) const generator.emit<Bytecode::Op::PutById>(Bytecode::Register::global_object(), generator.intern_string(id->string())); }, [&](const NonnullRefPtr<BindingPattern>& binding) { - binding->for_each_assigned_name([&](const auto& name) { + binding->for_each_bound_name([&](const auto& name) { generator.emit<Bytecode::Op::LoadImmediate>(js_undefined()); generator.emit<Bytecode::Op::PutById>(Bytecode::Register::global_object(), generator.intern_string(name)); }); @@ -54,7 +54,7 @@ void ScopeNode::generate_bytecode(Bytecode::Generator& generator) const scope_variables_with_declaration_kind.set((size_t)generator.intern_string(id->string()).value(), { 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) { scope_variables_with_declaration_kind.set((size_t)generator.intern_string(name).value(), { js_undefined(), declaration.declaration_kind() }); }); }); |