Skip to content

Commit

Permalink
fixup: remove side-effects from constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
apapirovski committed Dec 24, 2017
1 parent fdf0e05 commit 1d84f1d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/internal/process/next_tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,6 @@ function setupNextTick() {
triggerAsyncId,
this);
}

nextTickQueue.push(this);
}
}

Expand All @@ -166,7 +164,8 @@ function setupNextTick() {
args[i - 1] = arguments[i];
}

new TickObject(callback, args, getDefaultTriggerAsyncId());
nextTickQueue.push(new TickObject(callback, args,
getDefaultTriggerAsyncId()));
}

// `internalNextTick()` will not enqueue any callback when the process is
Expand Down Expand Up @@ -194,6 +193,6 @@ function setupNextTick() {

if (triggerAsyncId === null)
triggerAsyncId = getDefaultTriggerAsyncId();
new TickObject(callback, args, triggerAsyncId);
nextTickQueue.push(new TickObject(callback, args, triggerAsyncId));
}
}

0 comments on commit 1d84f1d

Please sign in to comment.