Skip to content

Commit 585ebff

Browse files
Amanpreet-03rvagg
authored andcommitted
test: replace closure with arrow functions
PR-URL: #24438 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ouyang Yadong <oyydoibh@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent d5543ea commit 585ebff

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/parallel/test-stream2-readable-empty-buffer-no-eof.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,17 @@ function test1() {
4646
r._read = function(n) {
4747
switch (reads--) {
4848
case 5:
49-
return setImmediate(function() {
49+
return setImmediate(() => {
5050
return r.push(buf);
5151
});
5252
case 4:
53-
setImmediate(function() {
53+
setImmediate(() => {
5454
return r.push(Buffer.alloc(0));
5555
});
5656
return setImmediate(r.read.bind(r, 0));
5757
case 3:
5858
setImmediate(r.read.bind(r, 0));
59-
return process.nextTick(function() {
59+
return process.nextTick(() => {
6060
return r.push(Buffer.alloc(0));
6161
});
6262
case 2:
@@ -78,12 +78,12 @@ function test1() {
7878
results.push(String(chunk));
7979
}
8080
r.on('readable', flow);
81-
r.on('end', function() {
81+
r.on('end', () => {
8282
results.push('EOF');
8383
});
8484
flow();
8585

86-
process.on('exit', function() {
86+
process.on('exit', () => {
8787
assert.deepStrictEqual(results, [ 'xxxxx', 'xxxxx', 'EOF' ]);
8888
console.log('ok');
8989
});
@@ -106,12 +106,12 @@ function test2() {
106106
results.push(String(chunk));
107107
}
108108
r.on('readable', flow);
109-
r.on('end', function() {
109+
r.on('end', () => {
110110
results.push('EOF');
111111
});
112112
flow();
113113

114-
process.on('exit', function() {
114+
process.on('exit', () => {
115115
assert.deepStrictEqual(results, [ 'eHh4', 'eHg=', 'EOF' ]);
116116
console.log('ok');
117117
});

0 commit comments

Comments
 (0)