| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 90f35fc commit 534409d
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -165,13 +165,13 @@ function eos(stream, options, callback) { | |||
| 165 | 165 | } else if ( | |
| 166 | 166 | !readable && | |
| 167 | 167 | (!willEmitClose || isReadable(stream)) && | |
| 168 | - (writableFinished || !isWritable(stream)) | ||
| 168 | + (writableFinished || isWritable(stream) === false) | ||
| 169 | 169 | ) { | |
| 170 | 170 | process.nextTick(onclose); | |
| 171 | 171 | } else if ( | |
| 172 | 172 | !writable && | |
| 173 | 173 | (!willEmitClose || isWritable(stream)) && | |
| 174 | - (readableFinished || !isReadable(stream)) | ||
| 174 | + (readableFinished || isReadable(stream) === false) | ||
| 175 | 175 | ) { | |
| 176 | 176 | process.nextTick(onclose); | |
| 177 | 177 | } else if ((rState && stream.req && stream.aborted)) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,8 @@ const { | |||
| 7 | 7 | Transform, | |
| 8 | 8 | finished, | |
| 9 | 9 | Duplex, | |
| 10 | - PassThrough | ||
| 10 | + PassThrough, | ||
| 11 | + Stream, | ||
| 11 | 12 | } = require('stream'); | |
| 12 | 13 | const assert = require('assert'); | |
| 13 | 14 | const EE = require('events'); | |
@@ -630,3 +631,11 @@ testClosed((opts) => new Writable({ write() {}, ...opts })); | |||
| 630 | 631 | })); | |
| 631 | 632 | })); | |
| 632 | 633 | } | |
| 634 | + | ||
| 635 | + { | ||
| 636 | + // Legacy Streams do not inherit from Readable or Writable. | ||
| 637 | + // We cannot really assume anything about them, so we cannot close them | ||
| 638 | + // automatically. | ||
| 639 | + const s = new Stream(); | ||
| 640 | + finished(s, common.mustNotCall()); | ||
| 641 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments