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 <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>
  • 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.