joyent/node — pull request #4537 by indutny (2013-01-08 18:00:01+00:00)
Title: streams: set listener first, emit 'data' later

When switching into compatibility mode by setting `data` event listener,
`_read()` method will be called immediately. If method implementation
invokes callback in the same tick - all emitted `data` events will be
discarded, because `data` listener wasn't set yet.

/cc @isaacs