1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:27:44 +00:00

LibJS: Add parameter to delete_property since we need DeleteOrThrow

This commit is contained in:
davidot 2021-06-21 16:06:32 +02:00 committed by Linus Groh
parent 8a06a93ce2
commit 16b87b85e3
4 changed files with 16 additions and 9 deletions

View file

@ -375,7 +375,7 @@ bool ProxyObject::put(const PropertyName& name, Value value, Value receiver)
return true;
}
bool ProxyObject::delete_property(const PropertyName& name)
bool ProxyObject::delete_property(PropertyName const& name, bool force_throw_exception)
{
auto& vm = this->vm();
if (m_is_revoked) {
@ -386,7 +386,7 @@ bool ProxyObject::delete_property(const PropertyName& name)
if (vm.exception())
return false;
if (!trap)
return m_target.delete_property(name);
return m_target.delete_property(name, force_throw_exception);
auto trap_result = vm.call(*trap, Value(&m_handler), Value(&m_target), name.to_value(vm));
if (vm.exception())
return false;