mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibJS/Bytecode: Prefer alias over name in object pattern bindings
10 new passes on test262. :^)
This commit is contained in:
parent
1dc7f03137
commit
aec3d9d84e
|
@ -1084,7 +1084,9 @@ static Bytecode::CodeGenerationErrorOr<void> generate_object_binding_pattern_byt
|
|||
Bytecode::Label { if_not_undefined_block });
|
||||
|
||||
generator.switch_to_basic_block(if_undefined_block);
|
||||
if (auto const* lhs = name.get_pointer<NonnullRefPtr<Identifier const>>()) {
|
||||
if (auto const* alias_identifier = alias.get_pointer<NonnullRefPtr<Identifier const>>()) {
|
||||
TRY(generator.emit_named_evaluation_if_anonymous_function(*initializer, (*alias_identifier)->string()));
|
||||
} else if (auto const* lhs = name.get_pointer<NonnullRefPtr<Identifier const>>()) {
|
||||
TRY(generator.emit_named_evaluation_if_anonymous_function(*initializer, (*lhs)->string()));
|
||||
} else {
|
||||
TRY(initializer->generate_bytecode(generator));
|
||||
|
|
Loading…
Reference in a new issue