GeezerVison is showing github.com — test: use arrow functions in callbacks · nodejs/node@4cc91ff
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: test/parallel/test-stream-pipe-await-drain.js +4-4Lines changed: 4 additions & 4 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -22,22 +22,22 @@ writer1._write = common.mustCall(function(chunk, encoding, cb) { | 22 | 22 | cb(); | 23 | 23 | }, 1); | 24 | 24 |
| 25 | | -writer1.once('chunk-received', function() { | | 25 | +writer1.once('chunk-received', () => { | 26 | 26 | assert.strictEqual( | 27 | 27 | reader._readableState.awaitDrain, | 28 | 28 | 0, | 29 | 29 | 'awaitDrain initial value should be 0, actual is ' + | 30 | 30 | reader._readableState.awaitDrain | 31 | 31 | ); | 32 | | - setImmediate(function() { | | 32 | + setImmediate(() => { | 33 | 33 | // This one should *not* get through to writer1 because writer2 is not | 34 | 34 | // "done" processing. | 35 | 35 | reader.push(buffer); | 36 | 36 | }); | 37 | 37 | }); | 38 | 38 |
| 39 | 39 | // A "slow" consumer: | 40 | | -writer2._write = common.mustCall(function(chunk, encoding, cb) { | | 40 | +writer2._write = common.mustCall((chunk, encoding, cb) => { | 41 | 41 | assert.strictEqual( | 42 | 42 | reader._readableState.awaitDrain, | 43 | 43 | 1, | @@ -49,7 +49,7 @@ writer2._write = common.mustCall(function(chunk, encoding, cb) { | 49 | 49 | // will return false. | 50 | 50 | }, 1); | 51 | 51 |
| 52 | | -writer3._write = common.mustCall(function(chunk, encoding, cb) { | | 52 | +writer3._write = common.mustCall((chunk, encoding, cb) => { | 53 | 53 | assert.strictEqual( | 54 | 54 | reader._readableState.awaitDrain, | 55 | 55 | 2, | |
|