Skip to content

Commit

Permalink
Use ArrayBuffer.prototype.slice polyfill for older browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
MattiasBuelens committed Jan 4, 2024
1 parent 6fe7a67 commit 5287cfd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/readable-stream/byte-stream-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
import type { ValidatedUnderlyingByteSource } from './underlying-source';
import { setFunctionName, typeIsObject } from '../helpers/miscellaneous';
import {
ArrayBufferSlice,
CanTransferArrayBuffer,
CopyDataBlockBytes,
IsDetachedBuffer,
Expand Down Expand Up @@ -495,7 +496,7 @@ function ReadableByteStreamControllerEnqueueClonedChunkToQueue(controller: Reada
byteLength: number) {
let clonedChunk;
try {
clonedChunk = buffer.slice(byteOffset, byteOffset + byteLength);
clonedChunk = ArrayBufferSlice(buffer, byteOffset, byteOffset + byteLength);
} catch (cloneE) {
ReadableByteStreamControllerError(controller, cloneE);
throw cloneE;
Expand Down

0 comments on commit 5287cfd

Please sign in to comment.