(stream)
| 842 | } |
| 843 | |
| 844 | function emitReadable_(stream) { |
| 845 | const state = stream._readableState; |
| 846 | debug('emitReadable_'); |
| 847 | if ((state[kState] & (kDestroyed | kErrored)) === 0 && (state.length || (state[kState] & kEnded) !== 0)) { |
| 848 | stream.emit('readable'); |
| 849 | state[kState] &= ~kEmittedReadable; |
| 850 | } |
| 851 | |
| 852 | // The stream needs another readable event if: |
| 853 | // 1. It is not flowing, as the flow mechanism will take |
| 854 | // care of it. |
| 855 | // 2. It is not ended. |
| 856 | // 3. It is below the highWaterMark, so we can schedule |
| 857 | // another readable later. |
| 858 | state[kState] |= |
| 859 | (state[kState] & (kFlowing | kEnded)) === 0 && |
| 860 | state.length <= state.highWaterMark ? kNeedReadable : 0; |
| 861 | flow(stream); |
| 862 | } |
| 863 | |
| 864 | |
| 865 | // At this point, the user has presumably seen the 'readable' event, |
no test coverage detected
searching dependent graphs…