Closed
Description
Reading through the Readable.from
code is seems to me that the semantics of using Readable.from
on a generator which yields null is not entirely clear.
Should we add a check for value == null
and throw?
async function next() {
try {
const { value, done } = await iterator.next();
if (done) {
readable.push(null);
} else if (readable.push(await value)) { // Hm, push(null) and then next()?
next();
} else {
reading = false;
}
} catch (err) {
readable.destroy(err);
}
}
Might also want to be a bit more explicit in the docs about this?
Metadata
Metadata
Assignees
Labels
No labels