mirror of
https://github.com/nodejs/node.git
synced 2024-12-01 16:10:02 +01:00
Revert "stream: remove ambiguous code"
This reverts commit ce62e963a1
.
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>
This commit is contained in:
parent
768287489a
commit
8c60685105
@ -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 = () => {
|
||||
|
Loading…
Reference in New Issue
Block a user