https: use kEmptyObject

PR-URL: https://github.com/nodejs/node/pull/43159
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
This commit is contained in:
LiviaMedeiros
2022-05-21 17:53:17 +08:00
committed by Antoine du Hamel
parent df68383ee9
commit 811cb8f685

View File

@@ -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');
@@ -206,7 +210,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 += ':';