@@ -60,15 +60,15 @@ function createServer(options, connectionListener) {
60
60
// connect(path, [cb]);
61
61
//
62
62
function connect ( ) {
63
- const args = new Array ( arguments . length ) ;
63
+ var args = new Array ( arguments . length ) ;
64
64
for ( var i = 0 ; i < arguments . length ; i ++ )
65
65
args [ i ] = arguments [ i ] ;
66
66
// TODO(joyeecheung): use destructuring when V8 is fast enough
67
- const normalized = normalizeArgs ( args ) ;
68
- const options = normalized [ 0 ] ;
69
- const cb = normalized [ 1 ] ;
67
+ var normalized = normalizeArgs ( args ) ;
68
+ var options = normalized [ 0 ] ;
69
+ var cb = normalized [ 1 ] ;
70
70
debug ( 'createConnection' , normalized ) ;
71
- const socket = new Socket ( options ) ;
71
+ var socket = new Socket ( options ) ;
72
72
73
73
if ( options . timeout ) {
74
74
socket . setTimeout ( options . timeout ) ;
@@ -893,13 +893,13 @@ function internalConnect(
893
893
894
894
895
895
Socket . prototype . connect = function ( ) {
896
- const args = new Array ( arguments . length ) ;
896
+ var args = new Array ( arguments . length ) ;
897
897
for ( var i = 0 ; i < arguments . length ; i ++ )
898
898
args [ i ] = arguments [ i ] ;
899
899
// TODO(joyeecheung): use destructuring when V8 is fast enough
900
- const normalized = normalizeArgs ( args ) ;
901
- const options = normalized [ 0 ] ;
902
- const cb = normalized [ 1 ] ;
900
+ var normalized = normalizeArgs ( args ) ;
901
+ var options = normalized [ 0 ] ;
902
+ var cb = normalized [ 1 ] ;
903
903
return realConnect . call ( this , options , cb ) ;
904
904
} ;
905
905
@@ -1350,19 +1350,19 @@ function listenInCluster(server, address, port, addressType,
1350
1350
1351
1351
1352
1352
Server . prototype . listen = function ( ) {
1353
- const args = new Array ( arguments . length ) ;
1353
+ var args = new Array ( arguments . length ) ;
1354
1354
for ( var i = 0 ; i < arguments . length ; i ++ )
1355
1355
args [ i ] = arguments [ i ] ;
1356
1356
// TODO(joyeecheung): use destructuring when V8 is fast enough
1357
- const normalized = normalizeArgs ( args ) ;
1357
+ var normalized = normalizeArgs ( args ) ;
1358
1358
var options = normalized [ 0 ] ;
1359
- const cb = normalized [ 1 ] ;
1359
+ var cb = normalized [ 1 ] ;
1360
1360
1361
1361
var hasCallback = ( cb !== null ) ;
1362
1362
if ( hasCallback ) {
1363
1363
this . once ( 'listening' , cb ) ;
1364
1364
}
1365
- const backlogFromArgs =
1365
+ var backlogFromArgs =
1366
1366
// (handle, backlog) or (path, backlog) or (port, backlog)
1367
1367
toNumber ( args . length > 1 && args [ 1 ] ) ||
1368
1368
toNumber ( args . length > 2 && args [ 2 ] ) ; // (port, host, backlog)
@@ -1391,11 +1391,12 @@ Server.prototype.listen = function() {
1391
1391
// ([port][, host][, backlog][, cb]) where port is specified
1392
1392
// or (options[, cb]) where options.port is specified
1393
1393
// or if options.port is normalized as 0 before
1394
+ var backlog ;
1394
1395
if ( typeof options . port === 'number' || typeof options . port === 'string' ) {
1395
1396
if ( ! isLegalPort ( options . port ) ) {
1396
1397
throw new RangeError ( '"port" argument must be >= 0 and < 65536' ) ;
1397
1398
}
1398
- const backlog = options . backlog || backlogFromArgs ;
1399
+ backlog = options . backlog || backlogFromArgs ;
1399
1400
// start TCP server listening on host:port
1400
1401
if ( options . host ) {
1401
1402
lookupAndListen ( this , options . port | 0 , options . host , backlog ,
@@ -1411,8 +1412,8 @@ Server.prototype.listen = function() {
1411
1412
// (path[, backlog][, cb]) or (options[, cb])
1412
1413
// where path or options.path is a UNIX domain socket or Windows pipe
1413
1414
if ( options . path && isPipeName ( options . path ) ) {
1414
- const pipeName = this . _pipeName = options . path ;
1415
- const backlog = options . backlog || backlogFromArgs ;
1415
+ var pipeName = this . _pipeName = options . path ;
1416
+ backlog = options . backlog || backlogFromArgs ;
1416
1417
listenInCluster ( this , pipeName , - 1 , - 1 ,
1417
1418
backlog , undefined , options . exclusive ) ;
1418
1419
return this ;
0 commit comments