MCPcopy Index your code
hub / github.com/nodejs/node / readableAddChunkPushObjectMode

Function readableAddChunkPushObjectMode

lib/internal/streams/readable.js:523–547  ·  view source on GitHub ↗
(stream, state, chunk, encoding)

Source from the content-addressed store, hash-verified

521}
522
523function readableAddChunkPushObjectMode(stream, state, chunk, encoding) {
524 if (chunk === null) {
525 state[kState] &= ~kReading;
526 onEofChunk(stream, state);
527 return false;
528 }
529
530 if ((state[kState] & kEnded) !== 0) {
531 errorOrDestroy(stream, new ERR_STREAM_PUSH_AFTER_EOF());
532 return false;
533 }
534
535 if ((state[kState] & (kDestroyed | kErrored)) !== 0) {
536 return false;
537 }
538
539 state[kState] &= ~kReading;
540
541 if ((state[kState] & kDecoder) !== 0 && !encoding) {
542 chunk = state[kDecoderValue].write(chunk);
543 }
544
545 addChunk(stream, state, chunk, false);
546 return canPushMore(state);
547}
548
549function canPushMore(state) {
550 // We can push more data if we are below the highWaterMark.

Callers 1

readable.jsFile · 0.85

Calls 5

onEofChunkFunction · 0.85
errorOrDestroyFunction · 0.85
addChunkFunction · 0.85
canPushMoreFunction · 0.85
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…