Skip to content

Commit

Permalink
stream: prevent object map change in ReadableState
Browse files Browse the repository at this point in the history
ReadableState has the resumeScheduled property that helps determine if
a stream should be resumed. It was not assigned in the constructor.
When stream.resume is called on a readable stream that is not flowing,
it is set to true. This changes the property map of the ReadableState
which can cause a deopt in onEofChunk and needMoreData.

PR-URL: #4761
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Brian White <mscdex@mscdex.net>
  • Loading branch information
evanlucas committed Jan 20, 2016
1 parent a347cd7 commit 426ff82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/_stream_readable.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ function ReadableState(options, stream) {
this.needReadable = false;
this.emittedReadable = false;
this.readableListening = false;
this.resumeScheduled = false;

// Crypto is kind of old and crusty. Historically, its default string
// encoding is 'binary' so we have to make this configurable.
Expand Down

0 comments on commit 426ff82

Please sign in to comment.