Skip to content

Commit 9bf2659

Browse files
nethraravindranrvagg
authored andcommitted
test: change anonymous closure function to arrow function
PR-URL: #24433 Reviewed-By: Michaël Zasso <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]>
1 parent e8c0fce commit 9bf2659

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

‎test/parallel/test-net-connect-options-port.js‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ const net = require('net');
7676
constexpectedConnections=72;
7777
letserverConnected=0;
7878

79-
constserver=net.createServer(common.mustCall(function(socket){
79+
constserver=net.createServer(common.mustCall((socket)=>{
8080
socket.end('ok');
8181
if(++serverConnected===expectedConnections){
8282
server.close();
8383
}
8484
},expectedConnections));
8585

86-
server.listen(0,'localhost',common.mustCall(function(){
87-
constport=this.address().port;
86+
server.listen(0,'localhost',common.mustCall(()=>{
87+
constport=server.address().port;
8888

8989
// Total connections = 3 * 4(canConnect) * 6(doConnect) = 72
9090
canConnect(port);
@@ -93,7 +93,7 @@ const net = require('net');
9393
}));
9494

9595
// Try connecting to random ports, but do so once the server is closed
96-
server.on('close',function(){
96+
server.on('close',()=>{
9797
asyncFailToConnect(0);
9898
asyncFailToConnect(/* undefined */);
9999
});
@@ -193,7 +193,7 @@ function canConnect(port){
193193
}
194194

195195
functionasyncFailToConnect(port){
196-
constonError=()=>common.mustCall(function(err){
196+
constonError=()=>common.mustCall((err)=>{
197197
constregexp=/^Error:connectE\w+.+$/;
198198
assert(regexp.test(String(err)),String(err));
199199
});

0 commit comments

Comments
(0)