Skip to content

Commit

Permalink
fixup: closeEmitted not needed on readable, yet
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Apr 26, 2020
1 parent b544f97 commit 706e189
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 0 additions & 4 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 2 additions & 6 deletions lib/internal/streams/destroy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 706e189

Please sign in to comment.