diff --git a/lib/cluster.js b/lib/cluster.js index 68a772a74a9b59..cf066657954bf8 100644 --- a/lib/cluster.js +++ b/lib/cluster.js @@ -244,8 +244,8 @@ function masterInit() { execArgv: process.execArgv, silent: false }; - settings = util._extend(settings, cluster.settings); - settings = util._extend(settings, options || {}); + settings = Object.assign(settings, cluster.settings); + settings = Object.assign(settings, options || {}); // Tell V8 to write profile data for each process to a separate file. // Without --logfile=v8-%p.log, everything ends up in a single, unusable // file. (Unusable because what V8 logs are memory addresses and each @@ -297,10 +297,10 @@ function masterInit() { var debugPortOffset = 1; function createWorkerProcess(id, env) { - var workerEnv = util._extend({}, process.env); + var workerEnv = Object.assign({}, process.env); var execArgv = cluster.settings.execArgv.slice(); - workerEnv = util._extend(workerEnv, env); + workerEnv = Object.assign(workerEnv, env); workerEnv.NODE_UNIQUE_ID = '' + id; for (var i = 0; i < execArgv.length; i++) { @@ -495,7 +495,7 @@ function masterInit() { // Set custom server data handle.add(worker, function(errno, reply, handle) { - reply = util._extend({ + reply = Object.assign({ errno: errno, key: key, ack: message.seq, @@ -573,7 +573,7 @@ function workerInit() { else indexes[key]++; - const message = util._extend({ + const message = Object.assign({ act: 'queryServer', index: indexes[key], data: null @@ -640,7 +640,7 @@ function workerInit() { } function getsockname(out) { - if (key) util._extend(out, message.sockname); + if (key) Object.assign(out, message.sockname); return 0; } @@ -735,7 +735,7 @@ var seq = 0; var callbacks = {}; function sendHelper(proc, message, handle, cb) { // Mark message as internal. See INTERNAL_PREFIX in lib/child_process.js - message = util._extend({ cmd: 'NODE_CLUSTER' }, message); + message = Object.assign({ cmd: 'NODE_CLUSTER' }, message); if (cb) callbacks[seq] = cb; message.seq = seq; seq += 1;