From 44f9fc3643afacad99405c59d89e767df3439928 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=BCrg=C3=BCn=20Day=C4=B1o=C4=9Flu?= Date: Sun, 26 Apr 2026 10:39:10 +0200 Subject: [PATCH] process: handle rejections only when needed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Gürgün Dayıoğlu PR-URL: https://github.com/nodejs/node/pull/62919 Reviewed-By: Stephen Belanger Reviewed-By: Matteo Collina Reviewed-By: Ilyas Shabi --- lib/internal/process/task_queues.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 84f406cd5e8..484fa4ea2f9 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -102,7 +102,8 @@ function processTicksAndRejections() { AsyncContextFrame.set(priorContextFrame); } runMicrotasks(); - } while (!queue.isEmpty() || processPromiseRejections()); + } while (!queue.isEmpty() || + (hasRejectionToWarn() && processPromiseRejections())); setHasTickScheduled(false); setHasRejectionToWarn(false); }