diff --git a/lib/internal/process/next_tick.js b/lib/internal/process/next_tick.js index 529645aa8d65c4..f27ef622a96e6a 100644 --- a/lib/internal/process/next_tick.js +++ b/lib/internal/process/next_tick.js @@ -131,12 +131,6 @@ function setupNextTick() { } while (tickInfo[kLength] !== 0); } - function TickObject(c, args) { - this.callback = c; - this.domain = process.domain || null; - this.args = args; - } - function nextTick(callback) { if (typeof callback !== 'function') throw new TypeError('callback is not a function'); @@ -151,7 +145,11 @@ function setupNextTick() { args[i - 1] = arguments[i]; } - nextTickQueue.push(new TickObject(callback, args)); + nextTickQueue.push({ + callback, + domain: process.domain || null, + args + }); tickInfo[kLength]++; } }