mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
LibJS: Allow converting a reference to an object to fail in delete
This is (part of) a normative change in the ECMA-262 spec. See: https://github.com/tc39/ecma262/commit/d09532c We recently implemented other parts of that commit in LibJS, but missed this change:442ca4f9b4
2b19d1b5ab
This commit is contained in:
parent
888af08638
commit
a2e245fa97
|
@ -170,8 +170,8 @@ ThrowCompletionOr<bool> Reference::delete_(VM& vm)
|
|||
if (is_super_reference())
|
||||
return vm.throw_completion<ReferenceError>(ErrorType::UnsupportedDeleteSuperProperty);
|
||||
|
||||
// c. Let baseObj be ! ToObject(ref.[[Base]]).
|
||||
auto base_obj = MUST(m_base_value.to_object(vm));
|
||||
// c. Let baseObj be ? ToObject(ref.[[Base]]).
|
||||
auto base_obj = TRY(m_base_value.to_object(vm));
|
||||
|
||||
// d. Let deleteStatus be ? baseObj.[[Delete]](ref.[[ReferencedName]]).
|
||||
bool delete_status = TRY(base_obj->internal_delete(m_name));
|
||||
|
|
Loading…
Reference in a new issue