diff options
author | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-18 03:15:57 +0100 |
---|---|---|
committer | Ruben Bridgewater <ruben@bridgewater.de> | 2018-12-20 13:52:44 +0100 |
commit | d4c91f28148af8a6c1a95392e5c88cb93d4b61c6 (patch) | |
tree | 482eb1a0470591925cb7a89c74f13b3b85717acb /lib/https.js | |
parent | 4b7a530f2b1a789b3feb64e3698d61b4ccc6bab5 (diff) | |
download | android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.gz android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.tar.bz2 android-node-v8-d4c91f28148af8a6c1a95392e5c88cb93d4b61c6.zip |
lib: remove internal `util._extends()` usage
This removes all internal calls to the deprecated `_extends()`
function. It is slower than `Object.assign()` and the object spread
notation since V8 6.8 and using the spread notation often also
results in shorter code.
PR-URL: https://github.com/nodejs/node/pull/25105
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'lib/https.js')
-rw-r--r-- | lib/https.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/https.js b/lib/https.js index 4a83853d07..90f561ab50 100644 --- a/lib/https.js +++ b/lib/https.js @@ -46,7 +46,7 @@ function Server(opts, requestListener) { requestListener = opts; opts = undefined; } - opts = util._extend({}, opts); + opts = { ...opts }; if (!opts.ALPNProtocols) { // http/1.0 is not defined as Protocol IDs in IANA @@ -110,9 +110,10 @@ function createConnection(port, host, options) { const session = this._getSession(options._agentKey); if (session) { debug('reuse session for %j', options._agentKey); - options = util._extend({ - session: session - }, options); + options = { + session, + ...options + }; } } @@ -292,7 +293,7 @@ function request(...args) { } if (args[0] && typeof args[0] !== 'function') { - options = util._extend(options, args.shift()); + Object.assign(options, args.shift()); } options._defaultAgent = globalAgent; |