Skip to content

Commit

Permalink
this commit will need to be rebased out once nodejs#19147 lands
Browse files Browse the repository at this point in the history
  • Loading branch information
apapirovski committed Mar 5, 2018
1 parent fd5890e commit 6595cac
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions lib/internal/process/next_tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function setupNextTick() {

// `internalNextTick()` will not enqueue any callback when the process is
// about to exit since the callback would not have a chance to be executed.
function internalNextTick(triggerAsyncId, callback) {
function internalNextTick(triggerAsyncId, callback, ...args) {
if (typeof callback !== 'function')
throw new errors.TypeError('ERR_INVALID_CALLBACK');
// CHECK(Number.isSafeInteger(triggerAsyncId) || triggerAsyncId === null)
Expand All @@ -162,18 +162,6 @@ function setupNextTick() {
if (process._exiting)
return;

var args;
switch (arguments.length) {
case 2: break;
case 3: args = [arguments[2]]; break;
case 4: args = [arguments[2], arguments[3]]; break;
case 5: args = [arguments[2], arguments[3], arguments[4]]; break;
default:
args = new Array(arguments.length - 2);
for (var i = 2; i < arguments.length; i++)
args[i - 2] = arguments[i];
}

if (triggerAsyncId === null)
triggerAsyncId = getDefaultTriggerAsyncId();
push(new TickObject(callback, args, triggerAsyncId));
Expand Down

0 comments on commit 6595cac

Please sign in to comment.