(controller, view)
| 11747 | ReadableByteStreamControllerRespondInternal(controller, bytesWritten); |
| 11748 | } |
| 11749 | function ReadableByteStreamControllerRespondWithNewView(controller, view) { |
| 11750 | const firstDescriptor = controller._pendingPullIntos.peek(); |
| 11751 | const state2 = controller._controlledReadableByteStream._state; |
| 11752 | if (state2 === "closed") { |
| 11753 | if (view.byteLength !== 0) { |
| 11754 | throw new TypeError("The view's length must be 0 when calling respondWithNewView() on a closed stream"); |
| 11755 | } |
| 11756 | } else { |
| 11757 | if (view.byteLength === 0) { |
| 11758 | throw new TypeError("The view's length must be greater than 0 when calling respondWithNewView() on a readable stream"); |
| 11759 | } |
| 11760 | } |
| 11761 | if (firstDescriptor.byteOffset + firstDescriptor.bytesFilled !== view.byteOffset) { |
| 11762 | throw new RangeError("The region specified by view does not match byobRequest"); |
| 11763 | } |
| 11764 | if (firstDescriptor.bufferByteLength !== view.buffer.byteLength) { |
| 11765 | throw new RangeError("The buffer of view has different capacity than byobRequest"); |
| 11766 | } |
| 11767 | if (firstDescriptor.bytesFilled + view.byteLength > firstDescriptor.byteLength) { |
| 11768 | throw new RangeError("The region specified by view is larger than byobRequest"); |
| 11769 | } |
| 11770 | const viewByteLength = view.byteLength; |
| 11771 | firstDescriptor.buffer = TransferArrayBuffer(view.buffer); |
| 11772 | ReadableByteStreamControllerRespondInternal(controller, viewByteLength); |
| 11773 | } |
| 11774 | function SetUpReadableByteStreamController(stream4, controller, startAlgorithm, pullAlgorithm, cancelAlgorithm, highWaterMark, autoAllocateChunkSize) { |
| 11775 | controller._controlledReadableByteStream = stream4; |
| 11776 | controller._pullAgain = false; |
no test coverage detected
searching dependent graphs…