mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 17:19:13 +00:00
LibJS: Convert Object::set() to ThrowCompletionOr
This commit is contained in:
parent
b7e5f08e56
commit
1d45541278
Notes:
sideshowbarker
2024-07-18 03:07:37 +09:00
Author: https://github.com/linusg
Commit: 1d45541278
Pull-request: https://github.com/SerenityOS/serenity/pull/10327
Reviewed-by: https://github.com/IdanHo ✅
18 changed files with 89 additions and 188 deletions
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue