mirror of
https://github.com/nodejs/node.git
synced 2025-05-03 09:52:21 +00:00

PR-URL: https://github.com/nodejs/node/pull/16938 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
27 lines
423 B
JavaScript
27 lines
423 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const stream = require('stream');
|
|
|
|
class Writable extends stream.Writable {
|
|
constructor() {
|
|
super();
|
|
this.prependListener = undefined;
|
|
}
|
|
|
|
_write(chunk, end, cb) {
|
|
cb();
|
|
}
|
|
}
|
|
|
|
class Readable extends stream.Readable {
|
|
_read() {
|
|
this.push(null);
|
|
}
|
|
}
|
|
|
|
const w = new Writable();
|
|
w.on('pipe', common.mustCall());
|
|
|
|
const r = new Readable();
|
|
r.pipe(w);
|