diff --git a/targets/wasm_exec.js b/targets/wasm_exec.js index e30f3256f..e61fa52ff 100644 --- a/targets/wasm_exec.js +++ b/targets/wasm_exec.js @@ -305,8 +305,7 @@ "syscall/js.finalizeRef": (v_ref) => { // Note: TinyGo does not support finalizers so this is only called // for one specific case, by js.go:jsString. and can/might leak memory. - const id = mem().getUint32(unboxValue(v_ref), true); - // Note that this if is so far seemingly never true. Someone should investigate why. + const id = v_ref & 0xffffffffn; if (this._goRefCounts?.[id] !== undefined) { this._goRefCounts[id]--; if (this._goRefCounts[id] === 0) { @@ -316,8 +315,7 @@ this._idPool.push(id); } } else { - // Log as a hint and reminder that something is probably off. - console.log("syscall/js.finalizeRef: unknown id", id); + console.error("syscall/js.finalizeRef: unknown id", id); } },