diff options
author | himself65 <himself65@outlook.com> | 2019-08-01 16:12:57 +0800 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2019-08-06 14:39:13 +0200 |
commit | 3c52dbe15b9e791359d20f9b52f9b8b58db90584 (patch) | |
tree | a47310643826e5ab6321b78f8e2e44115ded9fc7 | |
parent | 4a747f6037c7a589ae88b7a0238fea4218cce471 (diff) | |
download | node-new-3c52dbe15b9e791359d20f9b52f9b8b58db90584.tar.gz |
net: shallow copy option when create Server
PR-URL: https://github.com/nodejs/node/pull/28924
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
-rw-r--r-- | lib/net.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index 94b4e2a86c..09e34f75bd 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); |