Skip to content

Commit

Permalink
fix: 修复在 firfox 上偶现无法编译 wasm 的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohappy committed Dec 10, 2024
1 parent 2385efe commit ded855a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/avutil/function/compileResource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import * as cheapConfig from 'cheap/config'
import compile, { WebAssemblyResource } from 'cheap/webassembly/compiler'
import * as is from 'common/util/is'
import browser from 'common/util/browser'

export default async function compileResource(wasmUrl: string | ArrayBuffer | WebAssemblyResource, thread: boolean = false) {
let resource: WebAssemblyResource
Expand All @@ -37,8 +36,7 @@ export default async function compileResource(wasmUrl: string | ArrayBuffer | We
if (cheapConfig.USE_THREADS && defined(ENABLE_THREADS) && thread) {
resource.threadModule = await compile(
{
// firefox 使用 arraybuffer 会卡主
source: browser.firefox ? wasmUrl : resource.buffer
source: resource.buffer
},
{
child: true
Expand Down
2 changes: 1 addition & 1 deletion src/cheap
Submodule cheap updated 1 files
+6 −3 webassembly/compiler.ts

0 comments on commit ded855a

Please sign in to comment.