mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 03:57:43 +00:00
LibJS: Convert Object::set() to ThrowCompletionOr
This commit is contained in:
parent
b7e5f08e56
commit
1d45541278
18 changed files with 89 additions and 188 deletions
|
@ -77,10 +77,10 @@ void ObjectEnvironment::set_mutable_binding(GlobalObject& global_object, FlyStri
|
|||
return;
|
||||
}
|
||||
|
||||
auto result = m_binding_object.set(name, value, strict ? Object::ShouldThrowExceptions::Yes : Object::ShouldThrowExceptions::No);
|
||||
auto result_or_error = m_binding_object.set(name, value, strict ? Object::ShouldThrowExceptions::Yes : Object::ShouldThrowExceptions::No);
|
||||
|
||||
// Note: Nothing like this in the spec, this is here to produce nicer errors instead of the generic one thrown by Object::set().
|
||||
if (!result && strict) {
|
||||
if (result_or_error.is_error() && strict) {
|
||||
auto property_or_error = m_binding_object.internal_get_own_property(name);
|
||||
if (property_or_error.is_error())
|
||||
return;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue