bytecodealliance / javy

JS to WebAssembly toolchain
Apache License 2.0
2.1k stars 101 forks source link

[quickjs-wasm-sys] `JS_DupValue` is missing #607

Closed surma closed 5 months ago

surma commented 5 months ago

QuickJS has two functions to increment and decrement a JSValue’s reference count: JS_DupValue and JS_FreeValue respectively.

quickjs-wasm-sys has the latter (quickjs_wasm_sys::__JS_FreeValue) but not the former. This is necessary when working with raw QuickJS values and wanting to prevent them from getting GC’d.

I took a quick look but could not find a quick fix to this.

saulecabrera commented 5 months ago

@surma, this PR https://github.com/bytecodealliance/javy/pull/609 should address this issue.

saulecabrera commented 5 months ago

Oh actually there's a small issue with JS_ValueConst, I'll see if I can fix it.

saulecabrera commented 5 months ago

I think it should be fixed.