Skip to content

Commit

Permalink
stream: cleanup use of internal ended state
Browse files Browse the repository at this point in the history
PR-URL: #29645
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
  • Loading branch information
ckarande authored and BridgeAR committed Sep 24, 2019
1 parent 90b25b2 commit 4f00ef5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/internal/http2/compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ class Http2ServerRequest extends Readable {

get complete() {
return this[kAborted] ||
this._readableState.ended ||
this.readableEnded ||
this[kState].closed ||
this[kStream].destroyed;
}
Expand Down
4 changes: 2 additions & 2 deletions lib/internal/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,11 @@ class Worker extends EventEmitter {

const { stdout, stderr } = this[kParentSideStdio];

if (!stdout._readableState.ended) {
if (!stdout.readableEnded) {
debug(`[${threadId}] explicitly closes stdout for ${this.threadId}`);
stdout.push(null);
}
if (!stderr._readableState.ended) {
if (!stderr.readableEnded) {
debug(`[${threadId}] explicitly closes stderr for ${this.threadId}`);
stderr.push(null);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ function afterShutdown(status) {
if (self.destroyed)
return;

if (!self.readable || self._readableState.ended) {
if (!self.readable || self.readableEnded) {
debug('readableState ended, destroying');
self.destroy();
}
Expand Down

0 comments on commit 4f00ef5

Please sign in to comment.