| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -215,7 +215,7 @@ function eos(stream, options, callback) { | |||
| 215 | 215 | !readable && | |
| 216 | 216 | (!willEmitClose || isReadable(stream)) && | |
| 217 | 217 | (writableFinished || isWritable(stream) === false) && | |
| 218 | - (wState == null || wState.pendingcb === 0) | ||
| 218 | + (wState == null || wState.pendingcb === undefined || wState.pendingcb === 0) | ||
| 219 | 219 | ) { | |
| 220 | 220 | process.nextTick(onclosed); | |
| 221 | 221 | } else if ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -687,3 +687,16 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); | |||
| 687 | 687 | assert.strictEqual(stream._writableState.pendingcb, 0); | |
| 688 | 688 | })); | |
| 689 | 689 | } | |
| 690 | + | ||
| 691 | + { | ||
| 692 | + const stream = new Duplex({ | ||
| 693 | + write(chunk, enc, cb) {} | ||
| 694 | + }); | ||
| 695 | + | ||
| 696 | + stream.end('foo'); | ||
| 697 | + | ||
| 698 | + // Simulate an old stream implementation that doesn't have pendingcb | ||
| 699 | + delete stream._writableState.pendingcb; | ||
| 700 | + | ||
| 701 | + finished(stream, { readable: false }, common.mustCall()); | ||
| 702 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments