Skip to content

Commit

Permalink
stream: remove TODO and add a description instead
Browse files Browse the repository at this point in the history
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`.

PR-URL: #27086
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Matteo Collina <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
BridgeAR authored and targos committed May 4, 2019
1 parent f1efe6d commit 9d6d45e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/_stream_transform.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,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 coherence checks that can likely not be tested.
if (stream._writableState.length)
throw new ERR_TRANSFORM_WITH_LENGTH_0();

Expand Down

0 comments on commit 9d6d45e

Please sign in to comment.