Skip to content

Commit b12204e

Browse files
nimit95BethGriggs
authored andcommitted
test: changed function to arrow function
Convert callback functions that are anonymous to arrow functions for better readability. Also adjusted the `this` object in places where that was required. PR-URL: #32875 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 307e43d commit b12204e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎test/parallel/test-net-after-close.js‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const common = require('../common');
2424
constassert=require('assert');
2525
constnet=require('net');
2626

27-
constserver=net.createServer(common.mustCall(function(s){
27+
constserver=net.createServer(common.mustCall((s)=>{
2828
console.error('SERVER: got connection');
2929
s.end();
3030
}));
3131

32-
server.listen(0,common.mustCall(function(){
33-
constc=net.createConnection(this.address().port);
34-
c.on('close',common.mustCall(function(){
32+
server.listen(0,common.mustCall(()=>{
33+
constc=net.createConnection(server.address().port);
34+
c.on('close',common.mustCall(()=>{
3535
console.error('connection closed');
3636
assert.strictEqual(c._handle,null);
3737
// Calling functions / accessing properties of a closed socket should not

0 commit comments

Comments
 (0)