Skip to content

Commit a080fd1

Browse files
committed
fixup: paused
1 parent 906fd31 commit a080fd1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/_stream_readable.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ ObjectDefineProperty(ReadableState.prototype, 'paused', {
182182
return this[kPaused] !== false;
183183
},
184184
set(value) {
185-
this[kPaused] = Boolean(value);
185+
this[kPaused] = !!value;
186186
}
187187
});
188188

@@ -381,7 +381,8 @@ function chunkInvalid(state, chunk) {
381381

382382

383383
Readable.prototype.isPaused = function() {
384-
return this._readableState[kPaused] === true;
384+
const state = this._readableState;
385+
return state[kPaused] === true || state.flowing === false;
385386
};
386387

387388
// Backwards compatibility.

0 commit comments

Comments
 (0)