1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-28 21:22:08 +00:00

LibJS: Convert define_property_or_throw() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-03 01:35:36 +01:00
parent ebf57df431
commit fe86b04b42
12 changed files with 31 additions and 58 deletions

View file

@ -341,9 +341,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::define_property)
auto descriptor = to_property_descriptor(global_object, vm.argument(2));
if (vm.exception())
return {};
vm.argument(0).as_object().define_property_or_throw(key, descriptor);
if (vm.exception())
return {};
TRY_OR_DISCARD(vm.argument(0).as_object().define_property_or_throw(key, descriptor));
return vm.argument(0);
}