(controller)
| 2708 | } |
| 2709 | |
| 2710 | function readableByteStreamControllerClose(controller) { |
| 2711 | const { |
| 2712 | closeRequested, |
| 2713 | pendingPullIntos, |
| 2714 | queueTotalSize, |
| 2715 | stream, |
| 2716 | } = controller[kState]; |
| 2717 | |
| 2718 | if (closeRequested || stream[kState].state !== 'readable') |
| 2719 | return; |
| 2720 | |
| 2721 | if (queueTotalSize) { |
| 2722 | controller[kState].closeRequested = true; |
| 2723 | return; |
| 2724 | } |
| 2725 | |
| 2726 | if (pendingPullIntos.length) { |
| 2727 | const firstPendingPullInto = pendingPullIntos[0]; |
| 2728 | if (firstPendingPullInto.bytesFilled % firstPendingPullInto.elementSize !== 0) { |
| 2729 | const error = new ERR_INVALID_STATE.TypeError('Partial read'); |
| 2730 | readableByteStreamControllerError(controller, error); |
| 2731 | throw error; |
| 2732 | } |
| 2733 | } |
| 2734 | |
| 2735 | readableByteStreamControllerClearAlgorithms(controller); |
| 2736 | readableStreamClose(stream); |
| 2737 | } |
| 2738 | |
| 2739 | function readableByteStreamControllerCommitPullIntoDescriptor(stream, desc) { |
| 2740 | assert(stream[kState].state !== 'errored'); |
no test coverage detected
searching dependent graphs…