mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58: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
|
@ -117,9 +117,7 @@ JS_DEFINE_NATIVE_FUNCTION(ReflectObject::define_property)
|
|||
return {};
|
||||
|
||||
// 3. Let desc be ? ToPropertyDescriptor(attributes).
|
||||
auto descriptor = to_property_descriptor(global_object, attributes);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
auto descriptor = TRY_OR_DISCARD(to_property_descriptor(global_object, attributes));
|
||||
|
||||
// 4. Return ? target.[[DefineOwnProperty]](key, desc).
|
||||
return Value(TRY_OR_DISCARD(target.as_object().internal_define_own_property(key, descriptor)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue