Skip to content

Commit a02e782

Browse files
committed
process: handle rejections only when needed
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day>
1 parent da92246 commit a02e782

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

lib/internal/process/task_queues.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ function processTicksAndRejections() {
102102
AsyncContextFrame.set(priorContextFrame);
103103
}
104104
runMicrotasks();
105-
} while (!queue.isEmpty() || processPromiseRejections());
105+
} while (!queue.isEmpty() ||
106+
(hasRejectionToWarn() && processPromiseRejections()));
106107
setHasTickScheduled(false);
107108
setHasRejectionToWarn(false);
108109
}

0 commit comments

Comments
 (0)