mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 19:59:17 +00:00
LibJS/Bytecode: Support private identifiers in optional chaining
Fixes 4 test262 tests :^)
This commit is contained in:
committed by
Andreas Kling
parent
fc45831fb3
commit
95d619943e
@@ -2698,11 +2698,11 @@ static Bytecode::CodeGenerationErrorOr<void> generate_optional_chain(Bytecode::G
|
||||
generator.emit<Bytecode::Op::Store>(current_value_register);
|
||||
return {};
|
||||
},
|
||||
[&](OptionalChain::PrivateMemberReference const&) -> Bytecode::CodeGenerationErrorOr<void> {
|
||||
return Bytecode::CodeGenerationError {
|
||||
&optional_chain,
|
||||
"Unimplemented reference: PrivateMemberReference"sv,
|
||||
};
|
||||
[&](OptionalChain::PrivateMemberReference const& ref) -> Bytecode::CodeGenerationErrorOr<void> {
|
||||
generator.emit<Bytecode::Op::Store>(current_base_register);
|
||||
generator.emit<Bytecode::Op::GetPrivateById>(generator.intern_identifier(ref.private_identifier->string()));
|
||||
generator.emit<Bytecode::Op::Store>(current_value_register);
|
||||
return {};
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user