diff options
author | Daniel Moore <polaris@northhorizon.net> | 2013-04-29 17:25:08 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2013-05-08 22:59:28 +0400 |
commit | 1ad93a65844e6bf5c87fb4c5ca46f9c7fb2ebc9f (patch) | |
tree | ed5c19ade6144e8e69b5116789f52a191a711550 /lib | |
parent | cf87ee67eed4409bdd14a4d75b5d7053328cce91 (diff) |
stream: make Readable.wrap support objectMode
Added a check to see if the stream is in objectMode before deciding
whether to include or exclude data from an old-style wrapped stream.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/_stream_readable.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 070628288ee..63babe42655 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -767,7 +767,7 @@ Readable.prototype.wrap = function(stream) { stream.on('data', function(chunk) { if (state.decoder) chunk = state.decoder.write(chunk); - if (!chunk || !chunk.length) + if (!chunk || !state.objectMode && !chunk.length) return; var ret = self.push(chunk); |