Skip to content

Commit

Permalink
test: changed function to arrow function
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
nimit95 authored and BridgeAR committed Apr 28, 2020
1 parent e529a32 commit 87149c4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/parallel/test-net-after-close.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ const common = require('../common');
const assert = require('assert');
const net = require('net');

const server = net.createServer(common.mustCall(function(s) {
const server = net.createServer(common.mustCall((s) => {
console.error('SERVER: got connection');
s.end();
}));

server.listen(0, common.mustCall(function() {
const c = net.createConnection(this.address().port);
c.on('close', common.mustCall(function() {
server.listen(0, common.mustCall(() => {
const c = net.createConnection(server.address().port);
c.on('close', common.mustCall(() => {
console.error('connection closed');
assert.strictEqual(c._handle, null);
// Calling functions / accessing properties of a closed socket should not
Expand Down

0 comments on commit 87149c4

Please sign in to comment.