| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This condition could never be met because all calling functions guarded against this.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
| // If we get here before consuming all the bytes, then that is a | ||
| // bug in node. Should never happen. | ||
| if (state.length > 0) | ||
| throw new Error('"endReadable()" called on non-empty stream'); |
There was a problem hiding this comment.
I would keep this safety check in.
Sorry, something went wrong.
There was a problem hiding this comment.
It is dead code at the moment. There is no way to trigger it right now and only a false refactoring could trigger this.
Sorry, something went wrong.
There was a problem hiding this comment.
Just as reference - there are three occurrences of endReadable right now. Each of those are only triggered in case state.length === 0. Those guards are here
https://github.com/BridgeAR/node/blob/615ab68c02e81bc17dbfb15d489a3558f667dc67/lib/_stream_readable.js#L384
https://github.com/BridgeAR/node/blob/615ab68c02e81bc17dbfb15d489a3558f667dc67/lib/_stream_readable.js#L395
https://github.com/BridgeAR/node/blob/615ab68c02e81bc17dbfb15d489a3558f667dc67/lib/_stream_readable.js#L466
The function can also not be triggered from the outside.
Sorry, something went wrong.
There was a problem hiding this comment.
This can be removed then, 👍 .
Sorry, something went wrong.
|
cc @nodejs/streams |
Sorry, something went wrong.
Sorry, something went wrong.
Sorry, something went wrong.
This condition could never be met because all calling functions guarded against this. PR-URL: nodejs#15665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs#15665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This condition could never be met because all calling functions guarded against this. PR-URL: nodejs/node#15665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: nodejs/node#15665 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
| Back | FazBrowse Home | New Git URL |
I removed some dead code and migrated the rest of the stream errors.
Checklist
Affected core subsystem(s)
stream