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 283a6b8

Browse filesBrowse files
Abhishek Dixitcodebytere
authored andcommitted
test: replace anonymous closure functions with arrow function
PR-URL: #24420 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 66c3dca commit 283a6b8
Copy full SHA for 283a6b8

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

‎test/parallel/test-tls-ticket-cluster.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-tls-ticket-cluster.js
+8-8Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if (cluster.isMaster) {
4444
const c = tls.connect(workerPort, {
4545
session: lastSession,
4646
rejectUnauthorized: false
47-
}, function() {
47+
}, () => {
4848
lastSession = c.getSession();
4949
c.end();
5050

@@ -60,7 +60,7 @@ if (cluster.isMaster) {
6060

6161
function fork() {
6262
const worker = cluster.fork();
63-
worker.on('message', function({ msg, port }) {
63+
worker.on('message', ({ msg, port }) => {
6464
console.error('[master] got %j', msg);
6565
if (msg === 'reused') {
6666
++reusedCount;
@@ -71,15 +71,15 @@ if (cluster.isMaster) {
7171
}
7272
});
7373

74-
worker.on('exit', function() {
74+
worker.on('exit', () => {
7575
console.error('[master] worker died');
7676
});
7777
}
7878
for (let i = 0; i < workerCount; i++) {
7979
fork();
8080
}
8181

82-
process.on('exit', function() {
82+
process.on('exit', () => {
8383
assert.strictEqual(reqCount, expectedReqCount);
8484
assert.strictEqual(reusedCount + 1, reqCount);
8585
});
@@ -91,7 +91,7 @@ const cert = fixtures.readSync('agent.crt');
9191

9292
const options = { key, cert };
9393

94-
const server = tls.createServer(options, function(c) {
94+
const server = tls.createServer(options, (c) => {
9595
if (c.isSessionReused()) {
9696
process.send({ msg: 'reused' });
9797
} else {
@@ -100,7 +100,7 @@ const server = tls.createServer(options, function(c) {
100100
c.end();
101101
});
102102

103-
server.listen(0, function() {
103+
server.listen(0, () => {
104104
const { port } = server.address();
105105
process.send({
106106
msg: 'listening',
@@ -111,14 +111,14 @@ server.listen(0, function() {
111111
process.on('message', function listener(msg) {
112112
console.error('[worker] got %j', msg);
113113
if (msg === 'die') {
114-
server.close(function() {
114+
server.close(() => {
115115
console.error('[worker] server close');
116116

117117
process.exit();
118118
});
119119
}
120120
});
121121

122-
process.on('exit', function() {
122+
process.on('exit', () => {
123123
console.error('[worker] exit');
124124
});

0 commit comments

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