1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-29 20:51:37 +00:00

Fix anyref closure transformations

* Catch all closures by walking all `Descriptor` values and looking for
  either `Function` or `Closure`.
* Update the correct arguments for wasm by ensuring that the closure
  modifications skip the first two arguments.
This commit is contained in:
Alex Crichton
2019-06-03 11:36:18 -07:00
parent b51df39bc9
commit 3b5e3edd18
4 changed files with 72 additions and 19 deletions
crates/cli-support/src
src

@ -1178,6 +1178,7 @@ impl<'a, 'b> Rust2Js<'a, 'b> {
//
// But for now, we just bounce wasm -> js -> wasm because it is
// easy.
self.cx.require_internal_export("__wbindgen_anyref_heap_live_count_impl")?;
"wasm.__wbindgen_anyref_heap_live_count_impl()".into()
} else {
self.cx.expose_global_heap();