implement missing finalizeRef implementation from go wasm_exec.js
This commit is contained in:
parent
65516fbd50
commit
2c7adbef06
12
wfa.js
12
wfa.js
@ -300,10 +300,14 @@
|
|||||||
|
|
||||||
// func finalizeRef(v ref)
|
// func finalizeRef(v ref)
|
||||||
"syscall/js.finalizeRef": (v_ref) => {
|
"syscall/js.finalizeRef": (v_ref) => {
|
||||||
// Note: TinyGo does not support finalizers so this should never be
|
const id = mem().getUint32(unboxValue(v_ref), true);
|
||||||
// called.
|
this._goRefCounts[id]--;
|
||||||
//console.error('syscall/js.finalizeRef not implemented');
|
if (this._goRefCounts[id] === 0) {
|
||||||
// for whatever reason this is called by wfajs but doesnt impact the results at all??
|
const v = this._values[id];
|
||||||
|
this._values[id] = null;
|
||||||
|
this._ids.delete(v);
|
||||||
|
this._idPool.push(id);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// func stringVal(value string) ref
|
// func stringVal(value string) ref
|
||||||
|
Loading…
Reference in New Issue
Block a user