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

LibJS: Convert Object::set() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 00:32:43 +01:00
parent b7e5f08e56
commit 1d45541278
18 changed files with 89 additions and 188 deletions

View file

@ -489,9 +489,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::assign)
auto prop_value = TRY_OR_DISCARD(from->get(property_name));
// b. Perform ? Set(to, nextKey, propValue, true).
to->set(property_name, prop_value, Object::ShouldThrowExceptions::Yes);
if (vm.exception())
return {};
TRY_OR_DISCARD(to->set(property_name, prop_value, Object::ShouldThrowExceptions::Yes));
}
}