| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5d682c5 commit 786fbdb
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,7 +38,7 @@ const { | |||
| 38 | 38 | isTransformStream, | |
| 39 | 39 | isWebStream, | |
| 40 | 40 | isReadableStream, | |
| 41 | - isReadableEnded, | ||
| 41 | + isReadableFinished, | ||
| 42 | 42 | } = require('internal/streams/utils'); | |
| 43 | 43 | const { AbortController } = require('internal/abort_controller'); | |
| 44 | 44 | ||
@@ -424,7 +424,7 @@ function pipe(src, dst, finish, { end }) { | |||
| 424 | 424 | dst.end(); | |
| 425 | 425 | } | |
| 426 | 426 | ||
| 427 | - if (isReadableEnded(src)) { // End the destination if the source has already ended. | ||
| 427 | + if (isReadableFinished(src)) { // End the destination if the source has already ended. | ||
| 428 | 428 | process.nextTick(endFn); | |
| 429 | 429 | } else { | |
| 430 | 430 | src.once('end', endFn); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1634,3 +1634,31 @@ const tsp = require('timers/promises'); | |||
| 1634 | 1634 | assert.strictEqual(writable.closed, false); | |
| 1635 | 1635 | })); | |
| 1636 | 1636 | } | |
| 1637 | + | ||
| 1638 | + { | ||
| 1639 | + const r = new Readable(); | ||
| 1640 | + for (let i = 0; i < 4000; i++) { | ||
| 1641 | + r.push('asdfdagljanfgkaljdfn'); | ||
| 1642 | + } | ||
| 1643 | + r.push(null); | ||
| 1644 | + | ||
| 1645 | + let ended = false; | ||
| 1646 | + r.on('end', () => { | ||
| 1647 | + ended = true; | ||
| 1648 | + }); | ||
| 1649 | + | ||
| 1650 | + const w = new Writable({ | ||
| 1651 | + write(chunk, enc, cb) { | ||
| 1652 | + cb(null); | ||
| 1653 | + }, | ||
| 1654 | + final: common.mustCall((cb) => { | ||
| 1655 | + assert.strictEqual(ended, true); | ||
| 1656 | + cb(null); | ||
| 1657 | + }) | ||
| 1658 | + }); | ||
| 1659 | + | ||
| 1660 | + pipeline(r, w, common.mustCall((err) => { | ||
| 1661 | + assert.strictEqual(err, undefined); | ||
| 1662 | + })); | ||
| 1663 | + | ||
| 1664 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments