1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:08:12 +00:00

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.
This commit is contained in:
Luke Wilde 2022-03-15 01:49:13 +00:00 committed by Ali Mohammad Pur
parent 515f3e0b85
commit db1236b336

View file

@ -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();