Skip to content

Commit

Permalink
fixup: paused
Browse files Browse the repository at this point in the history
  • Loading branch information
ronag committed Dec 21, 2019
1 parent 906fd31 commit a080fd1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ ObjectDefineProperty(ReadableState.prototype, 'paused', {
return this[kPaused] !== false;
},
set(value) {
this[kPaused] = Boolean(value);
this[kPaused] = !!value;
}
});

Expand Down Expand Up @@ -381,7 +381,8 @@ function chunkInvalid(state, chunk) {


Readable.prototype.isPaused = function() {
return this._readableState[kPaused] === true;
const state = this._readableState;
return state[kPaused] === true || state.flowing === false;
};

// Backwards compatibility.
Expand Down

0 comments on commit a080fd1

Please sign in to comment.