Skip to content

Commit f454daa

Browse files
committed
fix
1 parent e031f41 commit f454daa

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

patch.js

+1
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ const afterMemoryTs = `export class Memory {
148148
const glueJs = readFileSync(`./src/wasm/pkg/${name}.js`, "utf8")
149149
.replaceAll(beforeMemoryJs, afterMemoryJs)
150150
.replaceAll(`free()`, `[Symbol.dispose]()`)
151+
.replaceAll(`new FinalizationRegistry(ptr => wasm.__wbg_memory_free(ptr >>> 0, 1))`, `{ register: () => {}, unregister: () => {} }`)
151152
.replaceAll(`module_or_path = new URL('${name}_bg.wasm', import.meta.url);`, `throw new Error();`)
152153

153154
const glueTs = readFileSync(`./src/wasm/pkg/${name}.d.ts`, "utf8")

src/wasm/pkg/memory_wasm.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ function passArray8ToWasm0(arg, malloc) {
2929

3030
const MemoryFinalization = (typeof FinalizationRegistry === 'undefined')
3131
? { register: () => {}, unregister: () => {} }
32-
: new FinalizationRegistry(ptr => wasm.__wbg_memory_free(ptr >>> 0, 1));
32+
: { register: () => {}, unregister: () => {} };
3333
/**
3434
*/
3535
export class Memory {

0 commit comments

Comments
 (0)