From 739dc8ef444102286be05df60a129d6ac5b9c963 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 4 Apr 2019 16:44:34 +0200 Subject: [PATCH 1/2] stream: remove TODO and add a description instead After looking into this it turned out that these two errors are sanity checks that should not be reached. It is unfortunate that we assigned error codes for these but changing it into an assertion seems to be a hassle for `readable-streams`. --- lib/_stream_transform.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index cec617dfb6bca7..9e22026c0ed824 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -207,9 +207,7 @@ function done(stream, er, data) { if (data != null) // Single equals check for both `null` and `undefined` stream.push(data); - // TODO(BridgeAR): Write a test for these two error cases - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided + // These two error cases are sanity checks that can likely not be tested. if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0(); From 6091ceae2bf18eed667436258b020eb55185aa6e Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Wed, 1 May 2019 13:42:19 +0200 Subject: [PATCH 2/2] fixup! stream: remove TODO and add a description instead --- lib/_stream_transform.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js index 9e22026c0ed824..ce06310ad07cc2 100644 --- a/lib/_stream_transform.js +++ b/lib/_stream_transform.js @@ -207,7 +207,7 @@ function done(stream, er, data) { if (data != null) // Single equals check for both `null` and `undefined` stream.push(data); - // These two error cases are sanity checks that can likely not be tested. + // These two error cases are coherence checks that can likely not be tested. if (stream._writableState.length) throw new ERR_TRANSFORM_WITH_LENGTH_0();