summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2019-10-09 19:52:32 +0200
committerMatteo Collina <hello@matteocollina.com>2019-10-10 10:34:10 +0200
commit8c606851056a1bb38abdcf7ab15df8ae35ba0cf9 (patch)
treeefec61a1ea0156711866551fc003ebff945902ed /lib
parent768287489a6d8feb956e8b9f004b08e1b11d62c5 (diff)
downloadandroid-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.js10
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 = () => {