File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Open diff view settings
Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Open diff view settings
Original file line number Diff line number Diff line change @@ -54,7 +54,10 @@ const {
5454 ERR_OUT_OF_RANGE ,
5555 } ,
5656} = require ( 'internal/errors' ) ;
57- const { once } = require ( 'internal/util' ) ;
57+ const {
58+ kEmptyObject,
59+ once,
60+ } = require ( 'internal/util' ) ;
5861const {
5962 validateNumber,
6063 validateOneOf,
@@ -220,7 +223,7 @@ Agent.defaultMaxSockets = Infinity;
220223Agent . prototype . createConnection = net . createConnection ;
221224
222225// Get the key for a given set of request options
223- Agent . prototype . getName = function getName ( options = { } ) {
226+ Agent . prototype . getName = function getName ( options = kEmptyObject ) {
224227 let name = options . host || 'localhost' ;
225228
226229 name += ':' ;
Original file line number Diff line number Diff line change @@ -43,7 +43,10 @@ const {
4343
4444const net = require ( 'net' ) ;
4545const assert = require ( 'internal/assert' ) ;
46- const { once } = require ( 'internal/util' ) ;
46+ const {
47+ kEmptyObject,
48+ once,
49+ } = require ( 'internal/util' ) ;
4750const {
4851 _checkIsHttpToken : checkIsHttpToken ,
4952 freeParser,
@@ -133,7 +136,7 @@ function ClientRequest(input, options, cb) {
133136
134137 if ( typeof options === 'function' ) {
135138 cb = options ;
136- options = input || { } ;
139+ options = input || kEmptyObject ;
137140 } else {
138141 options = ObjectAssign ( input || { } , options ) ;
139142 }
You can’t perform that action at this time.
0 commit comments