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

Function WritableStreamDefaultControllerAdvanceQueueIfNeeded

out/cli.cjs:12838–12860  ·  view source on GitHub ↗
(controller)

Source from the content-addressed store, hash-verified

12836 WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller);
12837 }
12838 function WritableStreamDefaultControllerAdvanceQueueIfNeeded(controller) {
12839 const stream4 = controller._controlledWritableStream;
12840 if (!controller._started) {
12841 return;
12842 }
12843 if (stream4._inFlightWriteRequest !== void 0) {
12844 return;
12845 }
12846 const state2 = stream4._state;
12847 if (state2 === "erroring") {
12848 WritableStreamFinishErroring(stream4);
12849 return;
12850 }
12851 if (controller._queue.length === 0) {
12852 return;
12853 }
12854 const value = PeekQueueValue(controller);
12855 if (value === closeSentinel) {
12856 WritableStreamDefaultControllerProcessClose(controller);
12857 } else {
12858 WritableStreamDefaultControllerProcessWrite(controller, value);
12859 }
12860 }
12861 function WritableStreamDefaultControllerErrorIfNeeded(controller, error) {
12862 if (controller._controlledWritableStream._state === "writable") {
12863 WritableStreamDefaultControllerError(controller, error);

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…