diff --git a/lib/internal/timers.js b/lib/internal/timers.js index 2441d7b194a..f48b4057a37 100644 --- a/lib/internal/timers.js +++ b/lib/internal/timers.js @@ -490,7 +490,7 @@ function getTimerCallbacks(runNextTicks) { let list; let ranAtLeastOneList = false; - while (list = timerListQueue.peek()) { + while ((list = timerListQueue.peek()) != null) { if (list.expiry > now) { nextExpiry = list.expiry; return refCount > 0 ? nextExpiry : -nextExpiry; @@ -511,7 +511,7 @@ function getTimerCallbacks(runNextTicks) { let ranAtLeastOneTimer = false; let timer; - while (timer = L.peek(list)) { + while ((timer = L.peek(list)) != null) { const diff = now - timer._idleStart; // Check if this loop iteration is too early for the next timer.