diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-01-16 16:19:04 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-16 15:19:04 +0000 |
commit | 40134ffc99848c89e0ab88c03ca85b9122e2384b (patch) | |
tree | 2ac19dcf02fcc10f5065eb7bd88b04323a2062fe /runtime/js/99_main.js | |
parent | 9d3483d4eb730cf9a8db4cb7d96dc5381518e92e (diff) |
refactor(core): rename pending_promise_exception to pending_promise_rejection (#17441)
These are technically rejections - a rejection can then raise an
exception.
Diffstat (limited to 'runtime/js/99_main.js')
-rw-r--r-- | runtime/js/99_main.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index d4a5a0a84..4fd6644db 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -323,13 +323,13 @@ delete Intl.v8BreakIterator; function promiseRejectCallback(type, promise, reason) { switch (type) { case 0: { - ops.op_store_pending_promise_exception(promise, reason); + ops.op_store_pending_promise_rejection(promise, reason); ArrayPrototypePush(pendingRejections, promise); WeakMapPrototypeSet(pendingRejectionsReasons, promise, reason); break; } case 1: { - ops.op_remove_pending_promise_exception(promise); + ops.op_remove_pending_promise_rejection(promise); const index = ArrayPrototypeIndexOf(pendingRejections, promise); if (index > -1) { ArrayPrototypeSplice(pendingRejections, index, 1); @@ -348,7 +348,7 @@ delete Intl.v8BreakIterator; function promiseRejectMacrotaskCallback() { while (pendingRejections.length > 0) { const promise = ArrayPrototypeShift(pendingRejections); - const hasPendingException = ops.op_has_pending_promise_exception( + const hasPendingException = ops.op_has_pending_promise_rejection( promise, ); const reason = WeakMapPrototypeGet(pendingRejectionsReasons, promise); @@ -369,7 +369,7 @@ delete Intl.v8BreakIterator; const errorEventCb = (event) => { if (event.error === reason) { - ops.op_remove_pending_promise_exception(promise); + ops.op_remove_pending_promise_rejection(promise); } }; // Add a callback for "error" event - it will be dispatched @@ -382,7 +382,7 @@ delete Intl.v8BreakIterator; // If event was not prevented (or "unhandledrejection" listeners didn't // throw) we will let Rust side handle it. if (rejectionEvent.defaultPrevented) { - ops.op_remove_pending_promise_exception(promise); + ops.op_remove_pending_promise_rejection(promise); } } return true; |