| 25058 | } |
| 25059 | |
| 25060 | function endReadable(stream) { |
| 25061 | var state = stream._readableState; |
| 25062 | |
| 25063 | // If we get here before consuming all the bytes, then that is a |
| 25064 | // bug in node. Should never happen. |
| 25065 | if (state.length > 0) throw new Error('"endReadable()" called on non-empty stream'); |
| 25066 | |
| 25067 | if (!state.endEmitted) { |
| 25068 | state.ended = true; |
| 25069 | processNextTick(endReadableNT, state, stream); |
| 25070 | } |
| 25071 | } |
| 25072 | |
| 25073 | function endReadableNT(state, stream) { |
| 25074 | // Check that we didn't get one last unshift. |