simple fix on SharedArrayBuffer is not defined (#7)

This commit is contained in:
Lukas
2025-04-13 22:59:06 +08:00
committed by GitHub
parent ef8e25c816
commit 20bf8f57e8

View File

@@ -10,7 +10,13 @@ export const isWasmSupported = () =>
Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00) Uint8Array.of(0x0, 0x61, 0x73, 0x6d, 0x01, 0x00, 0x00, 0x00)
); );
export const isMultiThreadSupported = () => SharedArrayBuffer !== undefined; export const isMultiThreadSupported = () => {
try {
return SharedArrayBuffer !== undefined;
} catch(e) {
return false;
}
};
export const isEngineSupported = (name: EngineName): boolean => { export const isEngineSupported = (name: EngineName): boolean => {
switch (name) { switch (name) {