diff options
author | Luke Wilde <lukew@serenityos.org> | 2022-03-15 01:49:13 +0000 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2022-03-15 11:57:51 +0330 |
commit | db1236b336c6d8b2a1cb5c79a635c26ae018ec8d (patch) | |
tree | 8f8613b887742e70a0bc7a9714bf68f25ce02fec | |
parent | 515f3e0b8596fda1fe7d39cccded71cbfbaa1c4b (diff) | |
download | serenity-db1236b336c6d8b2a1cb5c79a635c26ae018ec8d.zip |
LibJS/Bytecode: Fix typo in object binding an entry with no alias
In object binding, we would attempt to get NonnullRefPtr<Identifier>
from alias on the alias.has<Empty>() code path. In this case, we need
to get it from name instead.
-rw-r--r-- | Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp index 03c4fc0900..8860a00ef1 100644 --- a/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp +++ b/Userland/Libraries/LibJS/Bytecode/ASTCodegen.cpp @@ -979,7 +979,7 @@ static Bytecode::CodeGenerationErrorOr<void> generate_object_binding_pattern_byt }; } - auto& identifier = alias.get<NonnullRefPtr<Identifier>>()->string(); + auto& identifier = name.get<NonnullRefPtr<Identifier>>()->string(); generator.emit<Bytecode::Op::SetVariable>(generator.intern_identifier(identifier), initialization_mode); } else { auto& identifier = alias.get<NonnullRefPtr<Identifier>>()->string(); |