0
0
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:
Pushkal B 2018-11-17 18:19:08 +05:30 committed by Rich Trott
parent 38e59466a2
commit b3b5fc7c06

View File

@ -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);
});