From 4fbedffb55ec86e4900c950e4248b1d383bc28d3 Mon Sep 17 00:00:00 2001 From: LiviaMedeiros Date: Sat, 21 May 2022 17:53:17 +0800 Subject: [PATCH] https: use `kEmptyObject` PR-URL: https://github.com/nodejs/node/pull/43159 Reviewed-By: Matteo Collina Reviewed-By: Antoine du Hamel --- lib/https.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/https.js b/lib/https.js index 3834a881775..e41d79951fb 100644 --- a/lib/https.js +++ b/lib/https.js @@ -34,7 +34,11 @@ const { ReflectConstruct, } = primordials; -require('internal/util').assertCrypto(); +const { + assertCrypto, + kEmptyObject, +} = require('internal/util'); +assertCrypto(); const tls = require('tls'); const { Agent: HttpAgent } = require('_http_agent'); @@ -203,7 +207,7 @@ Agent.prototype.createConnection = createConnection; * }} [options] * @returns {string} */ -Agent.prototype.getName = function getName(options = {}) { +Agent.prototype.getName = function getName(options = kEmptyObject) { let name = FunctionPrototypeCall(HttpAgent.prototype.getName, this, options); name += ':';