mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
LibJS: Return the allocated dst register from deleting super properties
Even though calling delete on a super property will ultimately throw a ReferenceError, we must return the allocated register for the result of the delete operation (which would normally be a boolean). If the delete operation is used in a return statement, the bytecode generator for the return statement must be able to assume the statement had some output.
This commit is contained in:
@@ -812,7 +812,7 @@ CodeGenerationErrorOr<Optional<ScopedOperand>> Generator::emit_delete_reference(
|
||||
emit<Bytecode::Op::DeleteByIdWithThis>(dst, *super_reference.base, *super_reference.this_value, identifier_table_ref);
|
||||
}
|
||||
|
||||
return Optional<ScopedOperand> {};
|
||||
return dst;
|
||||
}
|
||||
|
||||
auto object = TRY(expression.object().generate_bytecode(*this)).value();
|
||||
|
||||
Reference in New Issue
Block a user