mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
test: use arrow functions for callbacks
PR-URL: https://github.com/nodejs/node/pull/24444 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
This commit is contained in:
parent
38e59466a2
commit
b3b5fc7c06
@ -41,17 +41,17 @@ const { Readable, Writable, PassThrough } = require('stream');
|
||||
.pipe(new PassThrough({ objectMode: true, highWaterMark: 2 }))
|
||||
.pipe(new PassThrough({ objectMode: true, highWaterMark: 2 }));
|
||||
|
||||
pt.on('end', function() {
|
||||
pt.on('end', () => {
|
||||
wrapper.push(null);
|
||||
});
|
||||
|
||||
const wrapper = new Readable({
|
||||
objectMode: true,
|
||||
read: () => {
|
||||
process.nextTick(function() {
|
||||
process.nextTick(() => {
|
||||
let data = pt.read();
|
||||
if (data === null) {
|
||||
pt.once('readable', function() {
|
||||
pt.once('readable', () => {
|
||||
data = pt.read();
|
||||
if (data !== null) wrapper.push(data);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user