mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
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: https://github.com/nodejs/node/pull/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>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user