mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibJS: Call [[Reject]] in PromiseResolveThenableJob after abrupt then()
This commit is contained in:
parent
194d90dc72
commit
878668efc9
Notes:
sideshowbarker
2024-07-18 02:13:10 +09:00
Author: https://github.com/linusg Commit: https://github.com/SerenityOS/serenity/commit/878668efc90 Pull-request: https://github.com/SerenityOS/serenity/pull/10913 Reviewed-by: https://github.com/IdanHo ✅
|
@ -138,16 +138,15 @@ ThrowCompletionOr<Value> PromiseResolveThenableJob::call()
|
|||
|
||||
// c. If thenCallResult is an abrupt completion, then
|
||||
if (then_call_result.is_error()) {
|
||||
auto error = then_call_result.throw_completion().value();
|
||||
vm.clear_exception();
|
||||
vm.stop_unwind();
|
||||
|
||||
// i. Let status be Call(resolvingFunctions.[[Reject]], undefined, « thenCallResult.[[Value]] »).
|
||||
// FIXME: Actually do this... not sure why we don't? :yakfused:
|
||||
dbgln_if(PROMISE_DEBUG, "[PromiseResolveThenableJob @ {}]: then_call_result is an abrupt completion, calling reject function with value {}", this, then_call_result.throw_completion().value());
|
||||
auto status = JS::call(global_object, &reject_function, js_undefined(), then_call_result.throw_completion().value());
|
||||
|
||||
// ii. Return Completion(status).
|
||||
dbgln_if(PROMISE_DEBUG, "[PromiseResolveThenableJob @ {}]: An exception was thrown, returning error {}", this, error);
|
||||
return error;
|
||||
return status;
|
||||
}
|
||||
|
||||
// d. Return Completion(thenCallResult).
|
||||
|
|
Loading…
Reference in a new issue