Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fdc67eb

Browse filesBrowse files
PoojaDurgadMylesBorins
authored andcommitted
test: replace annonymous functions with arrow
PR-URL: #34921 Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
1 parent cf07a86 commit fdc67eb
Copy full SHA for fdc67eb

File tree

Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+6
-6
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-net-reconnect.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-net-reconnect.js
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ const server = net.createServer(function(socket) {
3737
console.error('SERVER connect, writing');
3838
socket.write('hello\r\n');
3939

40-
socket.on('end', function() {
40+
socket.on('end', () => {
4141
console.error('SERVER socket end, calling end()');
4242
socket.end();
4343
});
4444

45-
socket.on('close', function(had_error) {
45+
socket.on('close', (had_error) => {
4646
console.log(`SERVER had_error: ${JSON.stringify(had_error)}`);
4747
assert.strictEqual(had_error, false);
4848
});
@@ -54,7 +54,7 @@ server.listen(0, function() {
5454

5555
client.setEncoding('UTF8');
5656

57-
client.on('connect', function() {
57+
client.on('connect', () => {
5858
console.error('CLIENT connected', client._writableState);
5959
});
6060

@@ -66,12 +66,12 @@ server.listen(0, function() {
6666
client.end();
6767
});
6868

69-
client.on('end', function() {
69+
client.on('end', () => {
7070
console.error('CLIENT end');
7171
client_end_count++;
7272
});
7373

74-
client.on('close', function(had_error) {
74+
client.on('close', (had_error) => {
7575
console.log('CLIENT disconnect');
7676
assert.strictEqual(had_error, false);
7777
if (disconnect_count++ < N)
@@ -81,7 +81,7 @@ server.listen(0, function() {
8181
});
8282
});
8383

84-
process.on('exit', function() {
84+
process.on('exit', () => {
8585
assert.strictEqual(disconnect_count, N + 1);
8686
assert.strictEqual(client_recv_count, N + 1);
8787
assert.strictEqual(client_end_count, N + 1);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.