| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent deab08b commit 56da8df
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -818,7 +818,7 @@ Readable.prototype.unpipe = function(dest) { | |||
| 818 | 818 | // remove all. | |
| 819 | 819 | var dests = state.pipes; | |
| 820 | 820 | state.pipes = []; | |
| 821 | - state.flowing = false; | ||
| 821 | + this.pause(); | ||
| 822 | 822 | ||
| 823 | 823 | for (const dest of dests) | |
| 824 | 824 | dest.emit('unpipe', this, { hasUnpiped: false }); | |
@@ -832,7 +832,7 @@ Readable.prototype.unpipe = function(dest) { | |||
| 832 | 832 | ||
| 833 | 833 | state.pipes.splice(index, 1); | |
| 834 | 834 | if (state.pipes.length === 0) | |
| 835 | - state.flowing = false; | ||
| 835 | + this.pause(); | ||
| 836 | 836 | ||
| 837 | 837 | dest.emit('unpipe', this, unpipeInfo); | |
| 838 | 838 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -84,3 +84,13 @@ assert.strictEqual(source._readableState.pipes.length, 0); | |||
| 84 | 84 | checkDestCleanup(dest2); | |
| 85 | 85 | source.unpipe(); | |
| 86 | 86 | } | |
| 87 | + | ||
| 88 | + { | ||
| 89 | + const src = Readable({ read: () => {} }); | ||
| 90 | + const dst = Writable({ write: () => {} }); | ||
| 91 | + src.pipe(dst); | ||
| 92 | + src.on('resume', common.mustCall(() => { | ||
| 93 | + src.on('pause', common.mustCall()); | ||
| 94 | + src.unpipe(dst); | ||
| 95 | + })); | ||
| 96 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments