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 94d200f

Browse filesBrowse files
Amanpreet-03codebytere
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 380da04 commit 94d200f
Copy full SHA for 94d200f

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

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

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

Copy file name to clipboardExpand all lines: test/parallel/test-stream2-readable-empty-buffer-no-eof.js
+7-7Lines changed: 7 additions & 7 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.