Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2b4e46f

Browse filesBrowse files
TrottBethGriggs
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 cf1d3d1 commit 2b4e46f
Copy full SHA for 2b4e46f

File tree

Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-2
lines changed
Open diff view settings
Collapse file

‎lib/internal/timers.js‎

Copy file name to clipboardExpand all lines: lib/internal/timers.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ function getTimerCallbacks(runNextTicks) {
490490

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

512512
let ranAtLeastOneTimer = false;
513513
let timer;
514-
while (timer = L.peek(list)) {
514+
while ((timer = L.peek(list)) != null) {
515515
const diff = now - timer._idleStart;
516516

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

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.