diff options
author | Matteo Collina <hello@matteocollina.com> | 2019-10-09 19:52:32 +0200 |
---|---|---|
committer | Matteo Collina <hello@matteocollina.com> | 2019-10-10 10:34:10 +0200 |
commit | 8c606851056a1bb38abdcf7ab15df8ae35ba0cf9 (patch) | |
tree | efec61a1ea0156711866551fc003ebff945902ed /lib | |
parent | 768287489a6d8feb956e8b9f004b08e1b11d62c5 (diff) | |
download | android-node-v8-8c606851056a1bb38abdcf7ab15df8ae35ba0cf9.tar.gz android-node-v8-8c606851056a1bb38abdcf7ab15df8ae35ba0cf9.tar.bz2 android-node-v8-8c606851056a1bb38abdcf7ab15df8ae35ba0cf9.zip |
Revert "stream: remove ambiguous code"
This reverts commit ce62e963a13044817b43b7a7c6ef794eaa5ae905.
PR-URL: https://github.com/nodejs/node/pull/29717
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/streams/end-of-stream.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/internal/streams/end-of-stream.js b/lib/internal/streams/end-of-stream.js index 585a52ae2f..949ab63814 100644 --- a/lib/internal/streams/end-of-stream.js +++ b/lib/internal/streams/end-of-stream.js @@ -59,9 +59,9 @@ function eos(stream, opts, callback) { }; } - const readable = opts.readable || + let readable = opts.readable || (opts.readable !== false && isReadable(stream)); - const writable = opts.writable || + let writable = opts.writable || (opts.writable !== false && isWritable(stream)); const onlegacyfinish = () => { @@ -69,13 +69,15 @@ function eos(stream, opts, callback) { }; const onfinish = () => { + writable = false; writableFinished = true; - if (!readable || readableEnded) callback.call(stream); + if (!readable) callback.call(stream); }; const onend = () => { + readable = false; readableEnded = true; - if (!writable || writableFinished) callback.call(stream); + if (!writable) callback.call(stream); }; const onclose = () => { |