Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34.3k
doc: readable.push() supports undefined in non-object mode#18283
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
doc: readable.push() supports undefined in non-object mode #18283
Uh oh!
There was an error while loading. Please reload this page.
Conversation
MoonBall commented Jan 21, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
doc/api/stream.md Outdated
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.
Perhaps just remove the *Note*: part, it's really not necessary
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.
because I don't know where it should be placed.
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.
@jasnell fixed
63ec723 to 5ec2d5aCompareBridgeAR commented Feb 1, 2018
Hm, I personally wonder if we really should support undefined. I liked #18244. If someone pushes |
MoonBall commented Feb 2, 2018
I also think that no support for |
BridgeAR commented Feb 6, 2018
@mcollina@mafintosh what do you two think about removing the support? Is there a good reason to support |
doc/api/stream.md Outdated
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.
What would mean for the chunk to be interpreted as an empty string of buffer?
Can you add another sentence explaining what is happening?
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.
@MoonBall ping
MoonBallFeb 23, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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 See also: readable.push('').
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 I added a sentence for readable.push('').
mcollina commented Feb 7, 2018
@BridgeAR there isn't. However, I do not see why removing that support would improve our API, so why breaking things? |
BridgeAR commented Feb 7, 2018
@mcollina the main point for me would be that pushing undefined might be a indicator for having a bug in the code and by prohibiting that it could unveil those bugs. |
mcollina commented Feb 7, 2018
let's land this and then we can fire the semver-major thing. |
BridgeAR commented Feb 13, 2018
@mcollina I would say we either document it or we want to deprecate it. But documenting something that we do not really want does not make a lot of sense to me. |
mcollina commented Feb 13, 2018
Removing or deprecating things are semver-major. A doc change can be easily backported. |
BridgeAR commented Feb 13, 2018
@mcollina I am aware that it is easy to backport a doc change but for me the question is: do we really want to document this? |
mcollina commented Feb 13, 2018
This has been part of streams for a very long time. We can consider it public knowledge and state the fact that this is supported behavior. |
5ec2d5a to c17c7ebCompare
mcollina left a comment
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.
LGTM
mcollina commented Feb 23, 2018
mcollina commented Feb 26, 2018
Landing. |
mcollina commented Feb 26, 2018
Landed in 8b518ed |
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: #18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: nodejs#18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: #18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: nodejs#18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. PR-URL: nodejs#18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
`readable.push()` supports `undefined` in non-object mode, but it was not previously documented. Backport-PR-URL: #22380 PR-URL: #18283 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
I found that the readable stream that isn't in object mode supports
undefinedlong ago, and it's original idea is to express EOF. Now it is just treated as a empty string or buffer. But the doc and code aren't clear for it although it is not important.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
doc, stream