wasm-bindgen/tests
Alex Crichton c0cad447c1 Initial support for closures
This commit starts wasm-bindgen down the path of supporting closures. We
discussed this at the recent Rust All-Hands but I ended up needing to pretty
significantly scale back the ambitions of what closures are supported. This
commit is just the initial support and provides only a small amount of support
but will hopefully provide a good basis for future implementations.

Specifically this commit adds support for passing `&Fn(...)` to an *imported
function*, but nothing elese. The `&Fn` type can have any lifetime and the JS
object is invalidated as soon as the import returns. The arguments and return
value of `Fn` must currently implement the `WasmAbi` trait, aka they can't
require any conversions like strings/types/etc.

I'd like to soon expand this to `&mut FnMut` as well as `'static` closures that
can be passed around for a long time in JS, but for now I'm putting that off
until later. I'm not currently sure how to implement richer argument types, but
hopefully that can be figured out at some point!
2018-04-09 14:34:21 -07:00
..
api.rs Generate node.js require directives for --nodejs 2018-03-29 01:47:44 -07:00
classes.rs Add some missing features to tests 2018-04-02 09:59:07 -07:00
closures.rs Initial support for closures 2018-04-09 14:34:21 -07:00
dependencies.rs Fix tests that are missing wasm_import_module 2018-04-03 11:28:25 +02:00
enums.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
import-class.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
imports.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
jsobjects.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
math.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
node.rs Reduce node/browser duplication 2018-04-03 13:12:28 -07:00
non-debug.rs Fix tests that are missing wasm_import_module 2018-04-03 11:28:25 +02:00
simple.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
slice.rs Leverage new rustc wasm features 2018-03-24 10:36:19 -07:00
structural.rs Generate node.js require directives for --nodejs 2018-03-29 01:47:44 -07:00