diff --git a/cli/tests/node_compat/test/parallel/test-stream-duplex-from.js b/cli/tests/node_compat/test/parallel/test-stream-duplex-from.js index c6ab181797d60..c91a040c51038 100644 --- a/cli/tests/node_compat/test/parallel/test-stream-duplex-from.js +++ b/cli/tests/node_compat/test/parallel/test-stream-duplex-from.js @@ -287,8 +287,6 @@ const { Blob } = require('buffer'); duplex.write('test'); } -/* -TODO(kt3k): Enable this test case { const through = new PassThrough({ objectMode: true }); @@ -309,7 +307,6 @@ TODO(kt3k): Enable this test case assert.strictEqual(res, 'foobar'); })).on('close', common.mustCall()); } -*/ function makeATestReadableStream(value) { return new ReadableStream({ diff --git a/ext/node/polyfills/_stream.mjs b/ext/node/polyfills/_stream.mjs index 23df11ab3dd11..d6db3020b59ea 100644 --- a/ext/node/polyfills/_stream.mjs +++ b/ext/node/polyfills/_stream.mjs @@ -4474,6 +4474,7 @@ var require_duplexify = __commonJS({ readable: false, }); } + if (typeof body === "function") { const { value, write, final, destroy } = fromAsyncGen(body); if (isIterable(value)) { @@ -4669,8 +4670,6 @@ var require_duplexify = __commonJS({ cb(err); } else if (err) { d.destroy(err); - } else if (!readable && !writable) { - d.destroy(); } } d = new Duplexify({