GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: replace closure with arrow functions · nodejs/node@585ebff

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-stream2-readable-empty-buffer-no-eof.js
Expand file treeCollapse file tree
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)
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.