From 706e1897e5d102d59f53379e375659064b6ca4cb Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Sun, 26 Apr 2020 11:05:19 +0200 Subject: [PATCH] fixup: closeEmitted not needed on readable, yet --- lib/_stream_readable.js | 4 ---- lib/internal/streams/destroy.js | 8 ++------ 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 6e6481316a1134..9a5b4c3c1b35c6 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -153,10 +153,6 @@ function ReadableState(options, stream, isDuplex) { // Indicates whether the stream has finished destroying. this.closed = false; - // True if close has been emitted or would have been emitted - // depending on emitClose. - this.closeEmitted = false; - // Crypto is kind of old and crusty. Historically, its default string // encoding is 'binary' so we have to make this configurable. // Everything else in the universe uses 'utf8', though. diff --git a/lib/internal/streams/destroy.js b/lib/internal/streams/destroy.js index 58dbc4ccd8914e..f17034c3b7aac5 100644 --- a/lib/internal/streams/destroy.js +++ b/lib/internal/streams/destroy.js @@ -76,9 +76,6 @@ function emitCloseNT(self) { if (w) { w.closeEmitted = true; } - if (r) { - r.closeEmitted = true; - } if ((w && w.emitClose) || (r && r.emitClose)) { self.emit('close'); @@ -108,14 +105,13 @@ function undestroy() { const w = this._writableState; if (r) { - r.destroyed = false; r.closed = false; - r.closeEmitted = false; + r.destroyed = false; r.errored = false; - r.errorEmitted = false; r.reading = false; r.ended = false; r.endEmitted = false; + r.errorEmitted = false; } if (w) {