mirror of
https://github.com/nodejs/node.git
synced 2025-04-29 14:25:18 +00:00

If we don't have any 'readable' or 'data' listeners and we are not about to resume. Then reset flowing state to initial null state. PR-URL: https://github.com/nodejs/node/pull/31036 Fixes: https://github.com/nodejs/node/issues/24474 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
20 lines
369 B
JavaScript
20 lines
369 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
|
|
const { Readable } = require('stream');
|
|
|
|
const readable = new Readable({
|
|
read() {}
|
|
});
|
|
|
|
function read() {}
|
|
|
|
readable.setEncoding('utf8');
|
|
readable.on('readable', read);
|
|
readable.removeListener('readable', read);
|
|
|
|
process.nextTick(function() {
|
|
readable.on('data', common.mustCall());
|
|
readable.push('hello');
|
|
});
|