Skip to content

Commit 1dadbee

Browse files
gurgundaymarco-ippolito
authored andcommitted
process: handle rejections only when needed
Signed-off-by: Gürgün Dayıoğlu <hey@gurgun.day> PR-URL: #62919 Reviewed-By: Stephen Belanger <admin@stephenbelanger.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ilyas Shabi <ilyasshabi94@gmail.com>
1 parent a418c50 commit 1dadbee

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
@@ -101,7 +101,8 @@ function processTicksAndRejections() {
101101
AsyncContextFrame.set(priorContextFrame);
102102
}
103103
runMicrotasks();
104-
} while (!queue.isEmpty() || processPromiseRejections());
104+
} while (!queue.isEmpty() ||
105+
(hasRejectionToWarn() && processPromiseRejections()));
105106
setHasTickScheduled(false);
106107
setHasRejectionToWarn(false);
107108
}

0 commit comments

Comments
 (0)