What steps will reproduce the bug?
const {Readable} = require('stream');
async function getBuffer(readable) {
const chunks = [];
for await (const chunk of readable) {
chunks.push(chunk);
}
return Buffer.concat(chunks);
}
const stream = new Readable({
read() {
this.push('chunk');
this.push(null);
}
});
const buffer = await getBuffer(stream);
console.log(stream.listenerCount('error'));
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
What do you see instead?
Additional information
The error handler seems to be from https://github.com/nodejs/node/blob/master/lib/internal/streams/end-of-stream.js
What steps will reproduce the bug?
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
What do you see instead?
Additional information
The
errorhandler seems to be from https://github.com/nodejs/node/blob/master/lib/internal/streams/end-of-stream.js