wasm-bindgen/tests/wasm
Nick Fitzgerald d5d3e46334 cli-support: Skip generating JS shims for imports when unnecessary
After this change, any import that only takes and returns ABI-safe numbers (signed
integers less than 64 bits and unrestricted floating point numbers) will be a
direct import, and will not have a little JS shim in the middle.

We don't have a great mechanism for testing the generated bindings' contents --
as opposed to its behavior -- but I manually verified that everything here does
the Right Thing and doesn't have a JS shim:

```rust
\#[wasm_bindgen]
extern "C" {
    fn trivial();

    fn incoming_i32() -> i32;
    fn incoming_f32() -> f32;
    fn incoming_f64() -> f64;

    fn outgoing_i32(x: i32);
    fn outgoing_f32(y: f32);
    fn outgoing_f64(z: f64);

    fn many(x: i32, y: f32, z: f64) -> i32;
}
```

Furthermore, I verified that when our support for emitting native `anyref` is
enabled, then we do not have a JS shim for the following import, but if it is
disabled, then we do have a JS shim:

```rust
\#[wasm_bindgen]
extern "C" {
    fn works_when_anyref_support_is_enabled(v: JsValue) -> JsValue;
}
```

Fixes #1636.
2019-07-11 15:44:16 -07:00
..
api.js Add an accessor for the function table 2019-04-08 10:40:46 -07:00
api.rs Add an accessor for the function table 2019-04-08 10:40:46 -07:00
arg_names.js Preserve argument names 2019-03-14 08:46:42 -03:00
arg_names.rs Preserve argument names 2019-03-14 08:46:42 -03:00
char.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
char.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
classes.js Generate bindings for indexed struct properties 2019-04-17 12:56:14 +01:00
classes.rs Generate bindings for indexed struct properties 2019-04-17 12:56:14 +01:00
closures.js First refactor for WebIDL bindings 2019-06-05 07:52:14 -07:00
closures.rs First refactor for WebIDL bindings 2019-06-05 07:52:14 -07:00
comments.js Move comments test to wasm 2018-08-06 11:46:23 -07:00
comments.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
duplicate_deps.js Migrate rest of dependencies test to wasm 2018-08-06 10:42:08 -07:00
duplicate_deps.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
duplicates_a.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_b.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates_c.js Support importing same-name statics from two modules 2018-08-20 10:56:58 -07:00
duplicates.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
enums.js Support Option with custom enums in JS 2019-01-28 14:27:57 -08:00
enums.rs Support Option with custom enums in JS 2019-01-28 14:27:57 -08:00
final.js Rename host_binding to final 2018-11-09 08:00:41 -08:00
final.rs Rename host_binding to final 2018-11-09 08:00:41 -08:00
getters_and_setters.js Add some tests which do computation in getters/setters 2019-04-30 10:02:11 -07:00
getters_and_setters.rs Run fmt and clippy 2019-05-28 09:52:44 -05:00
import_class.js Add support for importing default exports 2018-12-11 21:00:00 +02:00
import_class.rs Temporarily ignore intentionally failing test 2019-06-05 07:52:14 -07:00
imports.js Use static accessors if possible to get global object 2019-07-08 13:28:06 -07:00
imports.rs Use static accessors if possible to get global object 2019-07-08 13:28:06 -07:00
js_objects.js Migrate the serde-serialize test to wasm 2018-08-06 09:43:55 -07:00
js_objects.rs Fix importing and exporting the same name 2019-05-03 07:15:20 -07:00
jscast.js Implement #[wasm_bindgen(extends = ...)] 2018-08-07 13:04:11 -07:00
jscast.rs Migrate all crates to the 2018 edition 2019-03-26 08:10:53 -07:00
main.rs cli-support: Skip generating JS shims for imports when unnecessary 2019-07-11 15:44:16 -07:00
math.js Fix handling of u32 between Rust and JS 2019-03-27 13:37:14 -07:00
math.rs Run cargo fmt 2019-04-16 10:52:27 -07:00
no_shims.rs cli-support: Skip generating JS shims for imports when unnecessary 2019-07-11 15:44:16 -07:00
node.js Move node test over to wasm 2018-08-06 10:06:45 -07:00
node.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
option.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
option.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
optional_primitives.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
optional_primitives.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
rethrow.js Allow returning Result from functions 2018-09-18 13:13:59 -07:00
rethrow.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
simple.js Add a debug assert and more tests 2019-05-13 08:12:32 -07:00
simple.rs First refactor for WebIDL bindings 2019-06-05 07:52:14 -07:00
slice.js Add support for isize/usize arrays 2019-04-12 08:56:36 -07:00
slice.rs Add support for isize/usize arrays 2019-04-12 08:56:36 -07:00
structural.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
structural.rs Fix importing and exporting the same name 2019-05-03 07:15:20 -07:00
u64.js Port tests that use only basic features 2018-08-04 22:25:29 -05:00
u64.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
validate_prt.js Only generate JS null checks in debug mode 2018-09-21 16:10:02 -07:00
validate_prt.rs Assert all attributes are used by default 2018-11-28 11:42:48 -08:00
variadic.js Add docs and remove typecheck from variadic attribute 2018-09-01 13:55:35 +01:00
variadic.rs cargo +nightly fmt --all 2018-09-26 08:26:00 -07:00
vendor_prefix.js Rename polyfill to vendor_prefix 2018-10-01 14:45:30 -07:00
vendor_prefix.rs Add an optimization to directly wire up imported functions 2018-11-13 13:16:38 -08:00