summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-10-03 20:07:00 +0100
committerLinus Groh <mail@linusgroh.de>2021-10-04 09:52:15 +0100
commitd7d73f910061db9cf78d7ddcf12c35beff7c01f9 (patch)
treead1c5f18eb1fe5d227a914b645c04b1737e760a1 /Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
parent2f42675ebd244ed1bf3cd97ff2a6029cbc728226 (diff)
downloadserenity-d7d73f910061db9cf78d7ddcf12c35beff7c01f9.zip
LibJS: Convert to_property_descriptor() to ThrowCompletionOr
Also add spec step comments to it while we're here.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/ReflectObject.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/ReflectObject.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
index 8014263fb9..6013a6ecbd 100644
--- a/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
+++ b/Userland/Libraries/LibJS/Runtime/ReflectObject.cpp
@@ -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)));