stream: only end reading on null, not undefined
authorJonathan Reem <jonathan.reem@gmail.com>
Sat, 28 Jun 2014 18:46:42 +0000 (11:46 -0700)
committerFedor Indutny <fedor@indutny.com>
Mon, 30 Jun 2014 08:45:54 +0000 (12:45 +0400)
commit7fa4a9697d82fe811b73aea92492b66798420609
treeca143e6bca196f9a63091955ae4941eb71906ba8
parent73343d5ceef7cb4ddee1ed0ddd2c51d1958e3bb1
stream: only end reading on null, not undefined

The [Stream documentation for .push](http://nodejs.org/api/stream.html#stream_readable_push_chunk_encoding)
explicitly states multiple times that null is a special cased value
that indicates the end of a stream. It is confusing and undocumented
that undefined *also* ends the stream, even though in object mode
there is a distinct and important difference.

The docs for Object-Mode also explicitly mention null as the *only*
special cased value, making no mention of undefined.

Signed-off-by: Fedor Indutny <fedor@indutny.com>
lib/_stream_readable.js
test/simple/test-stream2-readable-non-empty-end.js