1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibJS: Convert Value::invoke and VM::call to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-09-23 20:56:28 +03:00
parent a90107b02a
commit ab594e5f2f
35 changed files with 196 additions and 328 deletions

View file

@ -62,11 +62,11 @@ Value PromiseReactionJob::call()
vm.stop_unwind();
auto* reject_function = promise_capability.value().reject;
dbgln_if(PROMISE_DEBUG, "[PromiseReactionJob @ {}]: Calling PromiseCapability's reject function @ {}", this, reject_function);
return vm.call(*reject_function, js_undefined(), handler_result);
return TRY_OR_DISCARD(vm.call(*reject_function, js_undefined(), handler_result));
} else {
auto* resolve_function = promise_capability.value().resolve;
dbgln_if(PROMISE_DEBUG, "[PromiseReactionJob @ {}]: Calling PromiseCapability's resolve function @ {}", this, resolve_function);
return vm.call(*resolve_function, js_undefined(), handler_result);
return TRY_OR_DISCARD(vm.call(*resolve_function, js_undefined(), handler_result));
}
}