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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 307e43d commit b12204e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ const common = require('../common');
2424
const assert = require('assert');
2525
const net = require('net');
2626

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

32-
server.listen(0, common.mustCall(function() {
33-
const c = net.createConnection(this.address().port);
34-
c.on('close', common.mustCall(function() {
32+
server.listen(0, common.mustCall(() => {
33+
const c = 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)