MCPcopy
hub / github.com/PokemonGoF/PokemonGo-Bot / endReadable

Function endReadable

map-chat/javascript/browserMqtt.js:3733–3752  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

3731}
3732
3733function endReadable(stream) {
3734 var state = stream._readableState;
3735
3736 // If we get here before consuming all the bytes, then that is a
3737 // bug in node. Should never happen.
3738 if (state.length > 0)
3739 throw new Error('endReadable called on non-empty stream');
3740
3741 if (!state.endEmitted && state.calledRead) {
3742 state.ended = true;
3743 process.nextTick(function() {
3744 // Check that we didn't get one last unshift.
3745 if (!state.endEmitted && state.length === 0) {
3746 state.endEmitted = true;
3747 stream.readable = false;
3748 stream.emit('end');
3749 }
3750 });
3751 }
3752}
3753
3754function forEach (xs, f) {
3755 for (var i = 0, l = xs.length; i < l; i++) {

Callers 2

browserMqtt.jsFile · 0.85
onEofChunkFunction · 0.85

Calls 1

emitMethod · 0.80

Tested by

no test coverage detected