From cf1d3d1565177ec37c26f5ad6ace690a3a1a4892 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 20 Jan 2022 06:28:03 -0800 Subject: [PATCH] process: check for null instead of falsy in while loop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This prepares the code for the no-cond-assign ESLint rule. PR-URL: https://github.com/nodejs/node/pull/41614 Reviewed-By: Tobias Nießen Reviewed-By: Anna Henningsen --- lib/internal/process/task_queues.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/internal/process/task_queues.js b/lib/internal/process/task_queues.js index 2a14b9dea68080..2c53b21040e5d8 100644 --- a/lib/internal/process/task_queues.js +++ b/lib/internal/process/task_queues.js @@ -68,7 +68,7 @@ function runNextTicks() { function processTicksAndRejections() { let tock; do { - while (tock = queue.shift()) { + while ((tock = queue.shift()) !== null) { const asyncId = tock[async_id_symbol]; emitBefore(asyncId, tock[trigger_async_id_symbol], tock);