From 4536128e7c9218f478354292f30720b39f6f4060 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 28 Sep 2017 17:47:21 -0300 Subject: [PATCH] stream: remove dead code This condition could never be met because all calling functions guarded against this. PR-URL: https://github.com/nodejs/node/pull/15665 Reviewed-By: Matteo Collina Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- lib/_stream_readable.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 1a0bc8902ac802..a863b3c37d6a3f 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -1040,11 +1040,6 @@ function copyFromBuffer(n, list) { function endReadable(stream) { var state = stream._readableState; - // 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'); - if (!state.endEmitted) { state.ended = true; process.nextTick(endReadableNT, state, stream);