@@ -653,10 +653,8 @@ Socket.prototype._writeGeneric = function(writev, data, encoding, cb) {
653
653
var chunks = new Array ( data . length << 1 ) ;
654
654
for ( var i = 0 ; i < data . length ; i ++ ) {
655
655
var entry = data [ i ] ;
656
- var chunk = entry . chunk ;
657
- var enc = entry . encoding ;
658
- chunks [ i * 2 ] = chunk ;
659
- chunks [ i * 2 + 1 ] = enc ;
656
+ chunks [ i * 2 ] = entry . chunk ;
657
+ chunks [ i * 2 + 1 ] = entry . encoding ;
660
658
}
661
659
err = this . _handle . writev ( req , chunks ) ;
662
660
@@ -808,14 +806,14 @@ function connect(self, address, port, addressType, localAddress, localPort) {
808
806
err = bind ( localAddress , localPort ) ;
809
807
810
808
if ( err ) {
811
- var ex = exceptionWithHostPort ( err , 'bind' , localAddress , localPort ) ;
809
+ const ex = exceptionWithHostPort ( err , 'bind' , localAddress , localPort ) ;
812
810
self . _destroy ( ex ) ;
813
811
return ;
814
812
}
815
813
}
816
814
817
815
if ( addressType === 6 || addressType === 4 ) {
818
- var req = new TCPConnectWrap ( ) ;
816
+ const req = new TCPConnectWrap ( ) ;
819
817
req . oncomplete = afterConnect ;
820
818
req . address = address ;
821
819
req . port = port ;
@@ -828,7 +826,7 @@ function connect(self, address, port, addressType, localAddress, localPort) {
828
826
err = self . _handle . connect6 ( req , address , port ) ;
829
827
830
828
} else {
831
- var req = new PipeConnectWrap ( ) ;
829
+ const req = new PipeConnectWrap ( ) ;
832
830
req . address = address ;
833
831
req . oncomplete = afterConnect ;
834
832
err = self . _handle . connect ( req , address , afterConnect ) ;
@@ -842,7 +840,7 @@ function connect(self, address, port, addressType, localAddress, localPort) {
842
840
details = sockname . address + ':' + sockname . port ;
843
841
}
844
842
845
- var ex = exceptionWithHostPort ( err , 'connect' , address , port , details ) ;
843
+ const ex = exceptionWithHostPort ( err , 'connect' , address , port , details ) ;
846
844
self . _destroy ( ex ) ;
847
845
}
848
846
}
@@ -1343,15 +1341,15 @@ Server.prototype.listen = function() {
1343
1341
else
1344
1342
listen ( self , null , h . port | 0 , 4 , backlog , undefined , h . exclusive ) ;
1345
1343
} else if ( h . path && isPipeName ( h . path ) ) {
1346
- var pipeName = self . _pipeName = h . path ;
1344
+ const pipeName = self . _pipeName = h . path ;
1347
1345
listen ( self , pipeName , - 1 , - 1 , backlog , undefined , h . exclusive ) ;
1348
1346
} else {
1349
1347
throw new Error ( 'Invalid listen argument: ' + h ) ;
1350
1348
}
1351
1349
}
1352
1350
} else if ( isPipeName ( arguments [ 0 ] ) ) {
1353
1351
// UNIX socket or Windows pipe.
1354
- var pipeName = self . _pipeName = arguments [ 0 ] ;
1352
+ const pipeName = self . _pipeName = arguments [ 0 ] ;
1355
1353
listen ( self , pipeName , - 1 , - 1 , backlog ) ;
1356
1354
1357
1355
} else if ( arguments [ 1 ] === undefined ||
0 commit comments