diff --git a/lib/timers.js b/lib/timers.js index d0077e6e8e1e6a..c9202cc0908bb9 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -652,7 +652,7 @@ function ImmediateList() { // Appends an item to the end of the linked list, adjusting the current tail's // previous and next pointers where applicable ImmediateList.prototype.append = function(item) { - if (this.tail) { + if (this.tail !== null) { this.tail._idleNext = item; item._idlePrev = this.tail; } else { @@ -664,11 +664,11 @@ ImmediateList.prototype.append = function(item) { // Removes an item from the linked list, adjusting the pointers of adjacent // items and the linked list's head or tail pointers as necessary ImmediateList.prototype.remove = function(item) { - if (item._idleNext) { + if (item._idleNext !== null) { item._idleNext._idlePrev = item._idlePrev; } - if (item._idlePrev) { + if (item._idlePrev !== null) { item._idlePrev._idleNext = item._idleNext; } @@ -694,7 +694,7 @@ function processImmediate() { // immediate callbacks are executed immediateQueue.head = immediateQueue.tail = null; - while (immediate) { + while (immediate !== null) { domain = immediate.domain; if (!immediate._onImmediate) { @@ -715,7 +715,7 @@ function processImmediate() { // If `clearImmediate(immediate)` wasn't called from the callback, use the // `immediate`'s next item - if (immediate._idleNext) + if (immediate._idleNext !== null) immediate = immediate._idleNext; else immediate = next; @@ -747,11 +747,11 @@ function tryOnImmediate(immediate, oldTail) { } } - if (threw && immediate._idleNext) { + if (threw && immediate._idleNext !== null) { // Handle any remaining on next tick, assuming we're still alive to do so. const curHead = immediateQueue.head; const next = immediate._idleNext; - if (curHead) { + if (curHead !== null) { curHead._idlePrev = oldTail; oldTail._idleNext = curHead; next._idlePrev = null;