diff --git a/lib/internal/cluster/master.js b/lib/internal/cluster/master.js index 9bdb0181d3db93..70707e359f4997 100644 --- a/lib/internal/cluster/master.js +++ b/lib/internal/cluster/master.js @@ -67,7 +67,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; @@ -104,7 +104,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 : '';