summaryrefslogtreecommitdiff
path: root/lib/https.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2018-12-18 03:15:57 +0100
committerAnna Henningsen <anna@addaleax.net>2019-01-14 13:58:05 +0100
commit3350230e208189aaac28cd2179806033674a0a71 (patch)
tree6a8b7ef54b36156cfe580c0bfd6463f0379c2817 /lib/https.js
parent901d3d095908bb6c136c06c5b30172d240c0f6be (diff)
downloadnode-new-3350230e208189aaac28cd2179806033674a0a71.tar.gz
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.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/https.js b/lib/https.js
index 06b37c2143..9611117699 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
+ };
}
}
@@ -291,7 +292,7 @@ function request(...args) {
}
if (args[0] && typeof args[0] !== 'function') {
- options = util._extend(options, args.shift());
+ Object.assign(options, args.shift());
}
options._defaultAgent = module.exports.globalAgent;