Skip to content
2 changes: 1 addition & 1 deletion lib/internal/streams/from.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function from(Readable, iterable, opts) {
} catch (e) {
error = error || e;
} finally {
cb(error);
process.nextTick(() => cb(error));
Comment thread
ronag marked this conversation as resolved.
Outdated
}
};
Comment thread
vadzim marked this conversation as resolved.

Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-readable-from-iterator-closing.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ async function closeStreamWhileNextIsPending() {

async function closeAfterNullYielded() {
const finallyMustCall = mustCall();
const bodyMustCall = mustCall(3);
const dataMustCall = mustCall(3);

function* infiniteGenerate() {
try {
Expand All @@ -182,7 +182,7 @@ async function closeAfterNullYielded() {
const stream = Readable.from(infiniteGenerate());

stream.on('data', (chunk) => {
bodyMustCall();
dataMustCall();
strictEqual(chunk, 'a');
});
}
Expand Down