diff --git a/src/lib/readable-stream/byte-stream-controller.ts b/src/lib/readable-stream/byte-stream-controller.ts index a5a9ee6..44d96ae 100644 --- a/src/lib/readable-stream/byte-stream-controller.ts +++ b/src/lib/readable-stream/byte-stream-controller.ts @@ -932,9 +932,9 @@ export function ReadableByteStreamControllerRespondWithNewView(controller: Reada throw new RangeError('The region specified by view is larger than byobRequest'); } + const viewByteLength = view.byteLength; firstDescriptor.buffer = TransferArrayBuffer(view.buffer); - - ReadableByteStreamControllerRespondInternal(controller, view.byteLength); + ReadableByteStreamControllerRespondInternal(controller, viewByteLength); } export function SetUpReadableByteStreamController(stream: ReadableByteStream,