| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 809e8dc commit 1655532
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,6 @@ const { | |||
| 32 | 32 | const { | |
| 33 | 33 | isDestroyed, | |
| 34 | 34 | isReadable, | |
| 35 | - isReadableEnded, | ||
| 36 | 35 | isWritable, | |
| 37 | 36 | isWritableEnded, | |
| 38 | 37 | } = require('internal/streams/utils'); | |
@@ -528,8 +527,6 @@ function newStreamReadableFromReadableStream(readableStream, options = kEmptyObj | |||
| 528 | 527 | reader.closed, | |
| 529 | 528 | () => { | |
| 530 | 529 | closed = true; | |
| 531 | - if (!isReadableEnded(readable)) | ||
| 532 | - readable.push(null); | ||
| 533 | 530 | }, | |
| 534 | 531 | (error) => { | |
| 535 | 532 | closed = true; | |
@@ -794,8 +791,6 @@ function newStreamDuplexFromReadableWritablePair(pair = kEmptyObject, options = | |||
| 794 | 791 | reader.closed, | |
| 795 | 792 | () => { | |
| 796 | 793 | readableClosed = true; | |
| 797 | - if (!isReadableEnded(duplex)) | ||
| 798 | - duplex.push(null); | ||
| 799 | 794 | }, | |
| 800 | 795 | (error) => { | |
| 801 | 796 | writableClosed = true; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,26 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const { mustCall } = require('../common'); | ||
| 3 | + const { Readable, Duplex } = require('stream'); | ||
| 4 | + const { strictEqual } = require('assert'); | ||
| 5 | + | ||
| 6 | + function start(controller) { | ||
| 7 | + controller.enqueue(new Uint8Array(1)); | ||
| 8 | + controller.close(); | ||
| 9 | + } | ||
| 10 | + | ||
| 11 | + Readable.fromWeb(new ReadableStream({ start })) | ||
| 12 | + .on('data', mustCall((d) => { | ||
| 13 | + strictEqual(d.length, 1); | ||
| 14 | + })) | ||
| 15 | + .on('end', mustCall()) | ||
| 16 | + .resume(); | ||
| 17 | + | ||
| 18 | + Duplex.fromWeb({ | ||
| 19 | + readable: new ReadableStream({ start }), | ||
| 20 | + writable: new WritableStream({ write(chunk) {} }) | ||
| 21 | + }) | ||
| 22 | + .on('data', mustCall((d) => { | ||
| 23 | + strictEqual(d.length, 1); | ||
| 24 | + })) | ||
| 25 | + .on('end', mustCall()) | ||
| 26 | + .resume(); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments