Skip to content

Commit

Permalink
stream: fix Readable stream state properties
Browse files Browse the repository at this point in the history
Looks like they have been accidentally moved in
nodejs#31144. This also adds the proxy
properties to Readable since they have been present all this time
and removing them would be breaking.
  • Loading branch information
lundibundi committed Aug 23, 2020
1 parent ac3049d commit caeb4e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,6 +1215,22 @@ ObjectDefineProperties(Readable.prototype, {
}
},

pipesCount: {
enumerable: false,
get() {
return this._readableState ? this._readableState.pipesCount : 0;
}
},

paused: {
enumerable: false,
get() {
return this._readableState ? this._readableState.paused : false;
}
}
});

ObjectDefineProperties(ReadableState.prototype, {
// Legacy getter for `pipesCount`
pipesCount: {
get() {
Expand Down

0 comments on commit caeb4e8

Please sign in to comment.