From 426ff820f5ee7d5c58ab3e90f28f07a2d568f8c1 Mon Sep 17 00:00:00 2001 From: Evan Lucas Date: Tue, 19 Jan 2016 08:53:38 -0600 Subject: [PATCH] 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: https://github.com/nodejs/node/pull/4761 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Brian White --- lib/_stream_readable.js | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 7074cd2ca508a5..33a5f0a7733e1f 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -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.