-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
stream: make sure readable is called on empty chunk followed by eof #29762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| 'use strict'; | ||
|
|
||
| const common = require('../common'); | ||
| const makeDuplexPair = require('../common/duplexpair'); | ||
|
|
||
| const { clientSide, serverSide } = makeDuplexPair(); | ||
|
|
||
| serverSide.resume(); | ||
| serverSide.on('end', function(buf) { | ||
| serverSide.write('out'); | ||
| serverSide.write(''); | ||
| serverSide.write(''); | ||
| serverSide.end(); | ||
| }); | ||
|
|
||
| clientSide.end(); | ||
|
|
||
| clientSide.on('data', common.mustCall()); | ||
| clientSide.on('end', common.mustCall()); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,7 +44,7 @@ class TestReader extends R { | |
| } | ||
|
|
||
| const reader = new TestReader(); | ||
| setImmediate(function() { | ||
| process.nextTick(function() { | ||
|
||
| assert.strictEqual(ondataCalled, 1); | ||
| console.log('ok'); | ||
| reader.push(null); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mcollina: Please also observe this change. I'm pretty sure it's fine but just making sure I have a second opinion on that.