@@ -127,8 +127,8 @@ function ClientRequest(options, cb) {
127
127
'Expected "' + expectedProtocol + '"' ) ;
128
128
}
129
129
130
- const defaultPort = options . defaultPort ||
131
- this . agent && this . agent . defaultPort ;
130
+ var defaultPort = options . defaultPort ||
131
+ this . agent && this . agent . defaultPort ;
132
132
133
133
var port = options . port = options . port || defaultPort || 80 ;
134
134
var host = options . host = validateHost ( options . hostname , 'hostname' ) ||
@@ -226,7 +226,7 @@ function ClientRequest(options, cb) {
226
226
227
227
var called = false ;
228
228
229
- const oncreate = ( err , socket ) => {
229
+ var oncreate = ( err , socket ) => {
230
230
if ( called )
231
231
return ;
232
232
called = true ;
@@ -238,14 +238,15 @@ function ClientRequest(options, cb) {
238
238
this . _deferToConnect ( null , null , ( ) => this . _flush ( ) ) ;
239
239
} ;
240
240
241
+ var newSocket ;
241
242
if ( this . socketPath ) {
242
243
this . _last = true ;
243
244
this . shouldKeepAlive = false ;
244
- const optionsPath = {
245
+ var optionsPath = {
245
246
path : this . socketPath ,
246
247
timeout : this . timeout
247
248
} ;
248
- const newSocket = this . agent . createConnection ( optionsPath , oncreate ) ;
249
+ newSocket = this . agent . createConnection ( optionsPath , oncreate ) ;
249
250
if ( newSocket && ! called ) {
250
251
called = true ;
251
252
this . onSocket ( newSocket ) ;
@@ -270,7 +271,7 @@ function ClientRequest(options, cb) {
270
271
this . _last = true ;
271
272
this . shouldKeepAlive = false ;
272
273
if ( typeof options . createConnection === 'function' ) {
273
- const newSocket = options . createConnection ( options , oncreate ) ;
274
+ newSocket = options . createConnection ( options , oncreate ) ;
274
275
if ( newSocket && ! called ) {
275
276
called = true ;
276
277
this . onSocket ( newSocket ) ;
0 commit comments