Skip to content

Commit

Permalink
minor change
Browse files Browse the repository at this point in the history
  • Loading branch information
Uzlopak committed Mar 17, 2024
1 parent 388533c commit f362a6a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/internal/process/promises.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,8 @@ function handledRejection(promise) {
if (promiseInfo !== undefined) {
maybeUnhandledPromises.delete(promise);
if (promiseInfo.warned) {
const { uid } = promiseInfo;
// Generate the warning object early to get a good stack trace.
const warning = new PromiseRejectionHandledWarning(uid);
const warning = new PromiseRejectionHandledWarning(promiseInfo.uid);
ArrayPrototypePush(asyncHandledRejections, { promise, warning });
setHasRejectionToWarn(true);
}
Expand Down Expand Up @@ -457,9 +456,9 @@ function getUnhandledRejectionsMode() {
// a warning to be emitted which requires the microtask and next tick
// queues to be drained again.
function processPromiseRejections() {
let maybeScheduledTicksOrMicrotasks = asyncHandledRejections.length > 0;
let maybeScheduledTicksOrMicrotasks = asyncHandledRejections.length !== 0;

while (asyncHandledRejections.length > 0) {
while (asyncHandledRejections.length !== 0) {
const { promise, warning } = ArrayPrototypeShift(asyncHandledRejections);
if (!process.emit('rejectionHandled', promise)) {
process.emitWarning(warning);
Expand Down

0 comments on commit f362a6a

Please sign in to comment.