-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
stream: make null an invalid chunk to write in object mode #6170
Conversation
7f3a0cb
to
85454ee
Compare
@calvinmetcalf mind linking to the discussion for posterity? |
Yeah which reminds me I have to figure out how to post that On Tue, Apr 12, 2016, 4:23 PM Jeremiah Senkpiel [email protected]
|
|
||
var stream = require('stream'); | ||
var util = require('util'); | ||
|
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.
The requires can use const
:-)
Few nits, but otherwise LGTM |
@@ -177,13 +177,17 @@ function writeAfterEnd(stream, cb) { | |||
// how many bytes or characters. |
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.
I would add an explanation on the validation rules on before this function.
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.
this somewhat implies I 100% understand the current validation rules 😕
LGTM. Even though it's a major change, I will run it through CITGM, we should have no breakage. You might also give a spin to the benchmarks, just to check if there any regression (I had some unexpected surprises in the past). |
85454ee
to
94e0df5
Compare
ok fixed the nits and also reordered the checks to make them more clear and added the note |
var er = false; | ||
// always throw error if a null is written | ||
// if we are not in object mode then throw | ||
// if it is not a buffer, string, or undefined |
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.
very minor nit: capitalize Always
, add punctuation at the end.
LGTM again :) |
this harmonizes behavior between readable, writable, and transform streams so that they all handle nulls in object mode the same way by considering them invalid chunks.
94e0df5
to
401ff75
Compare
@nodejs/streams ... is this ready to go? |
All good for me. |
I plan to land this one today but I'm asking @thealphanerd to do a quick smoketest after landing 75487f0 |
this harmonizes behavior between readable, writable, and transform streams so that they all handle nulls in object mode the same way by considering them invalid chunks. PR-URL: #6170 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Landed in e7c077c |
this harmonizes behavior between readable, writable, and transform streams so that they all handle nulls in object mode the same way by considering them invalid chunks. PR-URL: nodejs#6170 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
this harmonizes behavior between readable, writable, and transform streams so that they all handle nulls in object mode the same way by considering them invalid chunks. PR-URL: #6170 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Checklist
Affected core subsystem(s)
Description of change
as discussed by @nodejs/streams
this harmonizes behavior between readable, writable, and transform
streams so that they all handle nulls in object mode the same way by
considering them invalid chunks.