test: replace closure with arrow functions
PR-URL: https://github.com/nodejs/node/pull/24440 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
This commit is contained in:
parent
15c2491e73
commit
47495e089a
@ -34,7 +34,7 @@ let reads = 0;
|
||||
|
||||
function _read() {
|
||||
if (reads === 0) {
|
||||
setTimeout(function() {
|
||||
setTimeout(() => {
|
||||
r.push(str);
|
||||
}, 1);
|
||||
reads++;
|
||||
@ -61,7 +61,7 @@ assert.strictEqual(chunk, str);
|
||||
chunk = r.read();
|
||||
assert.strictEqual(chunk, null);
|
||||
|
||||
r.once('readable', function() {
|
||||
r.once('readable', () => {
|
||||
// this time, we'll get *all* the remaining data, because
|
||||
// it's been added synchronously, as the read WOULD take
|
||||
// us below the hwm, and so it triggered a _read() again,
|
||||
|
Loading…
x
Reference in New Issue
Block a user