Skip to content

Commit 63a67f8

Browse files
Trottdanielleadams
authored andcommitted
timers: check for nullish instead of falsy in loops
This prepares the code for the no-cond-assign ESLint rule. PR-URL: #41614 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent f066246 commit 63a67f8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎lib/internal/timers.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function getTimerCallbacks(runNextTicks) {
490490

491491
letlist;
492492
letranAtLeastOneList=false;
493-
while(list=timerListQueue.peek()){
493+
while((list=timerListQueue.peek())!=null){
494494
if(list.expiry>now){
495495
nextExpiry=list.expiry;
496496
returnrefCount>0 ? nextExpiry : -nextExpiry;
@@ -511,7 +511,7 @@ function getTimerCallbacks(runNextTicks) {
511511

512512
letranAtLeastOneTimer=false;
513513
lettimer;
514-
while(timer=L.peek(list)){
514+
while((timer=L.peek(list))!=null){
515515
constdiff=now-timer._idleStart;
516516

517517
// Check if this loop iteration is too early for the next timer.

0 commit comments

Comments
 (0)