mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:38:11 +00:00
LibJS: Convert to_property_descriptor() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
parent
2f42675ebd
commit
d7d73f9100
6 changed files with 85 additions and 46 deletions
|
@ -334,9 +334,7 @@ JS_DEFINE_NATIVE_FUNCTION(ObjectConstructor::define_property)
|
|||
auto key = vm.argument(1).to_property_key(global_object);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto descriptor = to_property_descriptor(global_object, vm.argument(2));
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto descriptor = TRY_OR_DISCARD(to_property_descriptor(global_object, vm.argument(2)));
|
||||
TRY_OR_DISCARD(vm.argument(0).as_object().define_property_or_throw(key, descriptor));
|
||||
return vm.argument(0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue