diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index 46c77900f42d5e..dc8efc1f98e56b 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -66,7 +66,7 @@ cluster.setupMaster = function(options) { // process has its own memory mappings.) if (settings.execArgv.some((s) => s.startsWith('--prof')) && !settings.execArgv.some((s) => s.startsWith('--logfile='))) { - settings.execArgv = settings.execArgv.concat(['--logfile=v8-%p.log']); + settings.execArgv = [...settings.execArgv, '--logfile=v8-%p.log']; } cluster.settings = settings; @@ -103,7 +103,7 @@ function setupSettingsNT(settings) { function createWorkerProcess(id, env) { const workerEnv = { ...process.env, ...env, NODE_UNIQUE_ID: `${id}` }; - const execArgv = cluster.settings.execArgv.slice(); + const execArgv = [...cluster.settings.execArgv]; const debugArgRegex = /--inspect(?:-brk|-port)?|--debug-port/; const nodeOptions = process.env.NODE_OPTIONS ? process.env.NODE_OPTIONS : '';