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

LibJS/Bytecode: Handle object destructuring to member expression

19 new passes on test262. :^)
This commit is contained in:
Andreas Kling 2023-06-25 16:24:05 +02:00
parent 7005a91a1e
commit 6f0952c358

View file

@ -1081,6 +1081,8 @@ static Bytecode::CodeGenerationErrorOr<void> generate_object_binding_pattern_byt
if (create_variables)
generator.emit<Bytecode::Op::CreateVariable>(identifier_ref, Bytecode::Op::EnvironmentMode::Lexical, false);
generator.emit<Bytecode::Op::SetVariable>(identifier_ref, initialization_mode);
} else if (alias.has<NonnullRefPtr<MemberExpression const>>()) {
TRY(generator.emit_store_to_reference(alias.get<NonnullRefPtr<MemberExpression const>>()));
} else {
auto& identifier = alias.get<NonnullRefPtr<Identifier const>>()->string();
auto identifier_ref = generator.intern_identifier(identifier);