stream: start old-mode read in a next tick
authorFedor Indutny <fedor@indutny.com>
Fri, 16 May 2014 09:10:34 +0000 (13:10 +0400)
committerFedor Indutny <fedor@indutny.com>
Fri, 6 Jun 2014 04:12:07 +0000 (21:12 -0700)
commit2efe4ab7616669448f873b0417e9aa81221324e2
tree44fb686743cf4e83707e5ed85d7e8afec982bef2
parenta7dd0e51f326dfcc478cc897033e0cd7de62b65d
stream: start old-mode read in a next tick

Calling `.read()` in the same tick with `.on('data', ...)` may cause
users missing `error` events, because no `error` listeners were set yet.

fix #7618
lib/_stream_readable.js
lib/http.js
test/simple/test-stream-readable-data-sync-race.js [new file with mode: 0644]
test/simple/test-stream2-compatibility.js