Skip to content

Commit 7b76dae

Browse files
committed
fix: SharedArrayBuffer support
1 parent db5a6e0 commit 7b76dae

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

fallback/encoding.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ const fromSource = (x) => {
5151
if (x instanceof Uint8Array) return x
5252
if (x instanceof ArrayBuffer) return new Uint8Array(x)
5353
if (ArrayBuffer.isView(x)) return new Uint8Array(x.buffer, x.byteOffset, x.byteLength)
54-
if (globalThis.SharedArrayBuffer && x instanceof globalThis.SharedArrayBuffer) {
55-
return new Uint8Array(x.buffer, x.byteOffset, x.byteLength)
56-
}
57-
54+
if (globalThis.SharedArrayBuffer && x instanceof SharedArrayBuffer) return new Uint8Array(x)
5855
throw new TypeError('Argument must be a SharedArrayBuffer, ArrayBuffer or ArrayBufferView')
5956
}
6057

0 commit comments

Comments
 (0)