Skip to content

Commit fb5ba6b

Browse files
evanlucasMyles Borins
authored and
Myles Borins
committed
stream: prevent object map change in ReadableState
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 <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Brian White <[email protected]>
1 parent 7c3b844 commit fb5ba6b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/_stream_readable.js

+1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ function ReadableState(options, stream) {
5151
this.needReadable = false;
5252
this.emittedReadable = false;
5353
this.readableListening = false;
54+
this.resumeScheduled = false;
5455

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

0 commit comments

Comments
 (0)