- Version: v10.15.0
- Platform: n/a
- Subsystem: stream
The test case:
const { Readable } = require('stream');
const stream = new Readable({
read(n) {}
});
process.nextTick(() => {
stream.push(Buffer.alloc(1));
stream.push(null);
});
(function checkFirstChunk() {
var chunk = stream.read();
if (!chunk)
return stream.once('readable', checkFirstChunk);
stream.unshift(chunk);
stream.on('end', () => {
console.log('file end');
}).resume();
})();
On node v8.x and node master, 'file end'
is logged to the console. On node v10.x, nothing is logged.
I wasn't sure if this is the same/similar underlying issue as #24474 or not, so I decided to submit this just in case.