mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-07 13:43:03 +03:00
22eb34d9ab
Currently the import object constructed for the `--target web` output only ever includes the current module as an one of the modules included. With `wasm-bindgen`'s optimization to import directly from modules, however, it's possible to have more modules imported from in the generated wasm file. This commit ensures that the imports are hooked up in the `--target web` es6 emulation mode, ensuring there aren't extraneous errors about import objects.
13 lines
234 B
Rust
13 lines
234 B
Rust
use wasm_bindgen::prelude::*;
|
|
use wasm_bindgen_test::*;
|
|
|
|
#[wasm_bindgen(raw_module = "./tests/headless/modules.js")]
|
|
extern "C" {
|
|
fn get_five() -> u32;
|
|
}
|
|
|
|
#[wasm_bindgen_test]
|
|
fn test_get_five() {
|
|
assert_eq!(get_five(), 5);
|
|
}
|