diff options
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp')
-rw-r--r-- | Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp index e605e8f9da..630afddb29 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/PromiseConstructor.cpp @@ -263,9 +263,7 @@ Value PromiseConstructor::construct(FunctionObject& new_target) return {}; } - auto* promise = ordinary_create_from_constructor<Promise>(global_object, new_target, &GlobalObject::promise_prototype); - if (vm.exception()) - return {}; + auto* promise = TRY_OR_DISCARD(ordinary_create_from_constructor<Promise>(global_object, new_target, &GlobalObject::promise_prototype)); auto [resolve_function, reject_function] = promise->create_resolving_functions(); |