joyent/node — pull request #7917 by chrisdickinson (2014-07-09 10:17:23+00:00)
Title: stream2: flush extant data on read of ended stream

A ReadableStream with a base64 StringDecoder backed by only
one or two bytes would fail to output its partial data before
ending. This fix adds a check to see if the `read` was triggered
by an internal `flow`, and if so, empties any remaining data.

Fixes #7914.