Skip to content

Commit caeb4e8

Browse files
committed
stream: fix Readable stream state properties
Looks like they have been accidentally moved in #31144. This also adds the proxy properties to Readable since they have been present all this time and removing them would be breaking.
1 parent ac3049d commit caeb4e8

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/_stream_readable.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,6 +1215,22 @@ ObjectDefineProperties(Readable.prototype, {
12151215
}
12161216
},
12171217

1218+
pipesCount: {
1219+
enumerable: false,
1220+
get() {
1221+
return this._readableState ? this._readableState.pipesCount : 0;
1222+
}
1223+
},
1224+
1225+
paused: {
1226+
enumerable: false,
1227+
get() {
1228+
return this._readableState ? this._readableState.paused : false;
1229+
}
1230+
}
1231+
});
1232+
1233+
ObjectDefineProperties(ReadableState.prototype, {
12181234
// Legacy getter for `pipesCount`
12191235
pipesCount: {
12201236
get() {

0 commit comments

Comments
 (0)