You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@rvagg, @isaacs I'm happy to look in to this and submit a PR.
Can you please confirm that sending stream.write(undefined), stream.write(null) and calling stream.end() should all end a Transform stream in the same way?
Is this the same behaviour for objectMode:true and objectMode:false?
Can you please confirm that sending stream.write(undefined), stream.write(null) and calling stream.end() should all end a Transform stream in the same way?
stream.write(null | undefined) should not end a stream -- the null EOF is only triggered through the readable's internal_-ish_ .push method.
It's down to this line -- specifically the isNull check. This sits at a weird place on the "bug or normal behavior" spectrum: without the check, all of the tests still pass, and in objectMode one would expect any value written to the stream to be transformed, but as it stands, in most cases null is an "out of alphabet" value for streams and represents the end of a stream.
(Tangentially, I'd love to move away from null-as-EOF in the future for this (and other) reasons.)
I'm closing this as the question was answered and there doesn't appear to be anything else immediately actionable here. Please feel free to re-open it if you disagree.
Activity
missinglink commentedon Dec 4, 2014
@rvagg, @isaacs I'm happy to look in to this and submit a PR.
Can you please confirm that sending
stream.write(undefined),stream.write(null)and callingstream.end()should all end aTransformstream in the same way?Is this the same behaviour for
objectMode:trueandobjectMode:false?ref: https://github.com/isaacs/readable-stream/blob/master/test/simple/test-stream2-transform.js#L453
chrisdickinson commentedon Dec 8, 2014
stream.write(null | undefined)should not end a stream -- thenullEOF is only triggered through the readable's internal_-ish_.pushmethod.It's down to this line -- specifically the
isNullcheck. This sits at a weird place on the "bug or normal behavior" spectrum: without the check, all of the tests still pass, and in objectMode one would expect any value written to the stream to be transformed, but as it stands, in most casesnullis an "out of alphabet" value for streams and represents the end of a stream.(Tangentially, I'd love to move away from
null-as-EOF in the future for this (and other) reasons.)sonewman commentedon Dec 28, 2014
I agree since it always feels weird to me calling
.push(null)when ending a readable stream.Qard commentedon Aug 14, 2015
I'm closing this as the question was answered and there doesn't appear to be anything else immediately actionable here. Please feel free to re-open it if you disagree.