From 5a671772a21997cde905f846110c7f34640ef09d Mon Sep 17 00:00:00 2001 From: himself65 Date: Fri, 6 Mar 2020 20:52:34 +0800 Subject: [PATCH] lib: use spread operator on cluster MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: /~https://github.com/nodejs/node/pull/32125 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: Tobias Nießen Reviewed-By: Ruben Bridgewater Reviewed-By: Trivikram Kamat --- lib/internal/cluster/master.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 : '';