-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
Description
This is kind of weird behavior I'm not sure what to think about. Iterating a cancelled readable stream will not throw...
const { ReadableStream } = require('stream/web')
const stream = new ReadableStream({
async start (controller) {
},
async pull () {
},
async cancel (reason) {
}
})
async function main () {
for await (const chunk of stream) {
}
assert(false) // ouch
}
stream.cancel(new Error())
main().catch(err => {
console.log(err)
})
This means that e.g. helpers from #39594 can succeeded without any data.