Skip to content

Commit 6595cac

Browse files
committed
this commit will need to be rebased out once nodejs#19147 lands
1 parent fd5890e commit 6595cac

1 file changed

Lines changed: 1 addition & 13 deletions

File tree

‎lib/internal/process/next_tick.js‎

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function setupNextTick() {
153153

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

165-
var args;
166-
switch (arguments.length) {
167-
case 2: break;
168-
case 3: args = [arguments[2]]; break;
169-
case 4: args = [arguments[2], arguments[3]]; break;
170-
case 5: args = [arguments[2], arguments[3], arguments[4]]; break;
171-
default:
172-
args = new Array(arguments.length - 2);
173-
for (var i = 2; i < arguments.length; i++)
174-
args[i - 2] = arguments[i];
175-
}
176-
177165
if (triggerAsyncId === null)
178166
triggerAsyncId = getDefaultTriggerAsyncId();
179167
push(new TickObject(callback, args, triggerAsyncId));

0 commit comments

Comments
 (0)