MCPcopy
hub / github.com/di-sukharev/opencommit / ReadableStreamDefaultControllerEnqueue

Function ReadableStreamDefaultControllerEnqueue

out/cli.cjs:13353–13376  ·  view source on GitHub ↗
(controller, chunk)

Source from the content-addressed store, hash-verified

13351 }
13352 }
13353 function ReadableStreamDefaultControllerEnqueue(controller, chunk) {
13354 if (!ReadableStreamDefaultControllerCanCloseOrEnqueue(controller)) {
13355 return;
13356 }
13357 const stream4 = controller._controlledReadableStream;
13358 if (IsReadableStreamLocked(stream4) && ReadableStreamGetNumReadRequests(stream4) > 0) {
13359 ReadableStreamFulfillReadRequest(stream4, chunk, false);
13360 } else {
13361 let chunkSize;
13362 try {
13363 chunkSize = controller._strategySizeAlgorithm(chunk);
13364 } catch (chunkSizeE) {
13365 ReadableStreamDefaultControllerError(controller, chunkSizeE);
13366 throw chunkSizeE;
13367 }
13368 try {
13369 EnqueueValueWithSize(controller, chunk, chunkSize);
13370 } catch (enqueueE) {
13371 ReadableStreamDefaultControllerError(controller, enqueueE);
13372 throw enqueueE;
13373 }
13374 }
13375 ReadableStreamDefaultControllerCallPullIfNeeded(controller);
13376 }
13377 function ReadableStreamDefaultControllerError(controller, e3) {
13378 const stream4 = controller._controlledReadableStream;
13379 if (stream4._state !== "readable") {

Callers 3

enqueueMethod · 0.85
pullAlgorithmFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…