Skip to content

Commit

Permalink
timers: compare to null not falsey
Browse files Browse the repository at this point in the history
  • Loading branch information
apapirovski committed Dec 7, 2017
1 parent 5ecc4a9 commit 253341a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/timers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
}

Expand All @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 253341a

Please sign in to comment.