From 3c52dbe15b9e791359d20f9b52f9b8b58db90584 Mon Sep 17 00:00:00 2001 From: himself65 Date: Thu, 1 Aug 2019 16:12:57 +0800 Subject: [PATCH] net: shallow copy option when create Server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/28924 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Masashi Hirano Reviewed-By: James M Snell Reviewed-By: Luigi Pinca Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Rich Trott --- lib/net.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 94b4e2a86cbed0..09e34f75bd01f2 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1078,7 +1078,7 @@ function Server(options, connectionListener) { options = {}; this.on('connection', connectionListener); } else if (options == null || typeof options === 'object') { - options = options || {}; + options = { ...options }; if (typeof connectionListener === 'function') { this.on('connection', connectionListener);