Skip to content

Instantly share code, notes, and snippets.

@idandagan1
Last active July 16, 2021 05:56
Show Gist options
  • Save idandagan1/c65a6aa8e4207727e4f90c4e91f43686 to your computer and use it in GitHub Desktop.
Save idandagan1/c65a6aa8e4207727e4f90c4e91f43686 to your computer and use it in GitHub Desktop.
function processPromiseRejections() {
...
...
let len = pendingUnhandledRejections.length;
while (len--) {
const promise = ArrayPrototypeShift(pendingUnhandledRejections);
const promiseInfo = maybeUnhandledPromises.get(promise);
if (promiseInfo === undefined) {
continue;
}
...
const { reason, uid, emit } = promiseInfo;
switch (unhandledRejectionsMode) {
case kStrictUnhandledRejections: { ... }
case kIgnoreUnhandledRejections: {
emit(reason, promise, promiseInfo);
break;
}
case kThrowUnhandledRejections: { ... }
case kWarnWithErrorCodeUnhandledRejections: { ... }
...
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment