diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index 375af0a23c6..852595c4dff 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -56,7 +56,6 @@ pub enum MethodSelf { #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] pub struct Import { pub module: Option, - pub version: Option, pub js_namespace: Option, pub kind: ImportKind, } @@ -301,33 +300,8 @@ impl Variant { impl Import { fn shared(&self) -> Result { - match (&self.module, &self.version) { - (&Some(ref m), None) if m.starts_with("./") => {} - (&Some(ref m), &Some(_)) if m.starts_with("./") => { - panic!( - "when a module path starts with `./` that indicates \ - that a local file is being imported so the `version` \ - key cannot also be specified" - ); - } - (&Some(_), &Some(_)) => {} - (&Some(_), &None) => panic!( - "when the `module` directive doesn't start with `./` \ - then it's interpreted as an NPM package which requires \ - a `version` to be specified as well, try using \ - #[wasm_bindgen(module = \"...\", version = \"...\")]" - ), - (&None, &Some(_)) => { - panic!( - "the #[wasm_bindgen(version = \"...\")] attribute can only \ - be used when `module = \"...\"` is also specified" - ); - } - (&None, &None) => {} - } Ok(shared::Import { module: self.module.clone(), - version: self.version.clone(), js_namespace: self.js_namespace.as_ref().map(|s| s.to_string()), kind: self.kind.shared(), }) diff --git a/crates/backend/src/util.rs b/crates/backend/src/util.rs index bab8cb5d228..f0bf53e71bc 100644 --- a/crates/backend/src/util.rs +++ b/crates/backend/src/util.rs @@ -94,7 +94,6 @@ pub fn ident_ty(ident: Ident) -> syn::Type { pub fn wrap_import_function(function: ast::ImportFunction) -> ast::Import { ast::Import { module: None, - version: None, js_namespace: None, kind: ast::ImportKind::Function(function), } diff --git a/crates/cli-support/Cargo.toml b/crates/cli-support/Cargo.toml index 6dc5a91a897..2c16e6089a4 100644 --- a/crates/cli-support/Cargo.toml +++ b/crates/cli-support/Cargo.toml @@ -15,7 +15,6 @@ base64 = "0.9" failure = "0.1.2" parity-wasm = "0.31" serde = "1.0" -serde_derive = "1.0" serde_json = "1.0" tempfile = "3.0" wasm-bindgen-shared = { path = "../shared", version = '=0.2.15' } diff --git a/crates/cli-support/src/js/mod.rs b/crates/cli-support/src/js/mod.rs index 9a63fc5d859..e1ad5939410 100644 --- a/crates/cli-support/src/js/mod.rs +++ b/crates/cli-support/src/js/mod.rs @@ -5,7 +5,6 @@ use std::mem; use failure::{Error, ResultExt}; use parity_wasm; use parity_wasm::elements::*; -use serde_json; use shared; use wasm_gc; @@ -43,7 +42,6 @@ pub struct Context<'a> { pub exported_classes: HashMap, pub function_table_needed: bool, pub run_descriptor: &'a Fn(&str) -> Option>, - pub module_versions: Vec<(String, String)>, } #[derive(Default)] @@ -458,7 +456,6 @@ impl<'a> Context<'a> { self.export_table(); self.gc()?; - self.add_wasm_pack_section(); while js.contains("\n\n\n") { js = js.replace("\n\n\n", "\n\n"); @@ -1629,28 +1626,6 @@ impl<'a> Context<'a> { self.globals.push_str("\n"); } - fn add_wasm_pack_section(&mut self) { - if self.module_versions.len() == 0 { - return; - } - - #[derive(Serialize)] - struct WasmPackSchema<'a> { - version: &'a str, - modules: &'a [(String, String)], - } - - let contents = serde_json::to_string(&WasmPackSchema { - version: "0.0.1", - modules: &self.module_versions, - }).unwrap(); - - let mut section = CustomSection::default(); - *section.name_mut() = "__wasm_pack_unstable".to_string(); - *section.payload_mut() = contents.into_bytes(); - self.module.sections_mut().push(Section::Custom(section)); - } - fn use_node_require(&self) -> bool { self.config.nodejs && !self.config.nodejs_experimental_modules } @@ -1766,7 +1741,6 @@ impl<'a, 'b> SubContext<'a, 'b> { } fn generate_import(&mut self, import: &shared::Import) -> Result<(), Error> { - self.validate_import_module(import)?; match import.kind { shared::ImportKind::Function(ref f) => { self.generate_import_function(import, f).with_context(|_| { @@ -1787,41 +1761,6 @@ impl<'a, 'b> SubContext<'a, 'b> { Ok(()) } - fn validate_import_module(&mut self, import: &shared::Import) -> Result<(), Error> { - let version = match import.version { - Some(ref s) => s, - None => return Ok(()), - }; - let module = match import.module { - Some(ref s) => s, - None => return Ok(()), - }; - if module.starts_with("./") { - return Ok(()); - } - let pkg = if module.starts_with("@") { - // Translate `@foo/bar/baz` to `@foo/bar` and `@foo/bar` to itself - let first_slash = match module.find('/') { - Some(i) => i, - None => bail!( - "packages starting with `@` must be of the form \ - `@foo/bar`, but found: `{}`", - module - ), - }; - match module[first_slash + 1..].find('/') { - Some(i) => &module[..i], - None => module, - } - } else { - module.split('/').next().unwrap() - }; - self.cx - .module_versions - .push((pkg.to_string(), version.clone())); - Ok(()) - } - fn generate_import_static( &mut self, info: &shared::Import, diff --git a/crates/cli-support/src/lib.rs b/crates/cli-support/src/lib.rs index d8cb8fdbaf6..5933a6919bd 100644 --- a/crates/cli-support/src/lib.rs +++ b/crates/cli-support/src/lib.rs @@ -2,8 +2,6 @@ extern crate parity_wasm; extern crate wasm_bindgen_shared as shared; -#[macro_use] -extern crate serde_derive; extern crate serde_json; extern crate wasm_gc; extern crate wasmi; @@ -203,7 +201,6 @@ impl Bindgen { config: &self, module: &mut module, function_table_needed: false, - module_versions: Default::default(), run_descriptor: &|name| { let mut v = MyExternals(Vec::new()); match instance.invoke_export(name, &[], &mut v) { diff --git a/crates/js-sys/tests/wasm/Function.rs b/crates/js-sys/tests/wasm/Function.rs index 02e9865f660..f2339496053 100644 --- a/crates/js-sys/tests/wasm/Function.rs +++ b/crates/js-sys/tests/wasm/Function.rs @@ -29,7 +29,7 @@ fn apply() { assert_eq!(Array::from(&arr).length(), 1); } -#[wasm_bindgen(module = "tests/wasm/Function.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Function.js")] extern { fn get_function_to_bind() -> Function; fn get_value_to_bind_to() -> JsValue; diff --git a/crates/js-sys/tests/wasm/Generator.rs b/crates/js-sys/tests/wasm/Generator.rs index 6d114b9f16e..5fb738fc3b4 100644 --- a/crates/js-sys/tests/wasm/Generator.rs +++ b/crates/js-sys/tests/wasm/Generator.rs @@ -2,7 +2,7 @@ use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; use js_sys::*; -#[wasm_bindgen(module = "tests/wasm/Generator.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Generator.js")] extern { fn one_two_generator() -> Generator; fn dummy_generator() -> Generator; diff --git a/crates/js-sys/tests/wasm/Object.rs b/crates/js-sys/tests/wasm/Object.rs index 802465354f3..da245a97dc2 100644 --- a/crates/js-sys/tests/wasm/Object.rs +++ b/crates/js-sys/tests/wasm/Object.rs @@ -10,7 +10,7 @@ extern { fn set_foo(this: &Foo42, val: JsValue); } -#[wasm_bindgen(module = "tests/wasm/Object.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Object.js")] extern { fn map_with_symbol_key() -> Object; fn symbol_key() -> JsValue; diff --git a/crates/js-sys/tests/wasm/Proxy.rs b/crates/js-sys/tests/wasm/Proxy.rs index b362b888126..30b23418fb1 100644 --- a/crates/js-sys/tests/wasm/Proxy.rs +++ b/crates/js-sys/tests/wasm/Proxy.rs @@ -2,7 +2,7 @@ use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; use js_sys::*; -#[wasm_bindgen(module = "tests/wasm/Proxy.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Proxy.js")] extern { fn proxy_target() -> JsValue; fn proxy_handler() -> Object; diff --git a/crates/js-sys/tests/wasm/Reflect.rs b/crates/js-sys/tests/wasm/Reflect.rs index a7c42748b6f..5f6f47f1779 100644 --- a/crates/js-sys/tests/wasm/Reflect.rs +++ b/crates/js-sys/tests/wasm/Reflect.rs @@ -2,7 +2,7 @@ use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; use js_sys::*; -#[wasm_bindgen(module = "tests/wasm/Reflect.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Reflect.js")] extern { fn get_char_at() -> Function; diff --git a/crates/js-sys/tests/wasm/Symbol.rs b/crates/js-sys/tests/wasm/Symbol.rs index cf455c44c60..a34a1ca2a3a 100644 --- a/crates/js-sys/tests/wasm/Symbol.rs +++ b/crates/js-sys/tests/wasm/Symbol.rs @@ -2,7 +2,7 @@ use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; use js_sys::*; -#[wasm_bindgen(module = "tests/wasm/Symbol.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/Symbol.js")] extern { fn test_has_instance(sym: &Symbol); fn test_is_concat_spreadable(sym: &Symbol); diff --git a/crates/macro-support/src/parser.rs b/crates/macro-support/src/parser.rs index 3752251d5e6..9c5bc23c8e2 100644 --- a/crates/macro-support/src/parser.rs +++ b/crates/macro-support/src/parser.rs @@ -53,17 +53,6 @@ impl BindgenAttrs { .next() } - /// Get the first version attribute - fn version(&self) -> Option<&str> { - self.attrs - .iter() - .filter_map(|a| match a { - BindgenAttr::Version(s) => Some(&s[..]), - _ => None, - }) - .next() - } - /// Whether the catch attribute is present fn catch(&self) -> bool { self.attrs.iter().any(|a| match a { @@ -195,7 +184,6 @@ pub enum BindgenAttr { StaticMethodOf(Ident), JsNamespace(Ident), Module(String), - Version(String), Getter(Option), Setter(Option), Structural, @@ -257,13 +245,6 @@ impl syn::synom::Synom for BindgenAttr { (s.value()) )=> { BindgenAttr::Module } | - do_parse!( - call!(term, "version") >> - punct!(=) >> - s: syn!(syn::LitStr) >> - (s.value()) - )=> { BindgenAttr::Version } - | do_parse!( call!(term, "js_name") >> punct!(=) >> @@ -909,10 +890,6 @@ impl<'a> MacroParse<&'a BindgenAttrs> for syn::ForeignItem { BindgenAttrs::find(attrs)? }; let module = item_opts.module().or(opts.module()).map(|s| s.to_string()); - let version = item_opts - .version() - .or(opts.version()) - .map(|s| s.to_string()); let js_namespace = item_opts.js_namespace().or(opts.js_namespace()).cloned(); let kind = match self { syn::ForeignItem::Fn(f) => f.convert((item_opts, &module))?, @@ -923,7 +900,6 @@ impl<'a> MacroParse<&'a BindgenAttrs> for syn::ForeignItem { program.imports.push(ast::Import { module, - version, js_namespace, kind, }); diff --git a/crates/shared/src/lib.rs b/crates/shared/src/lib.rs index c7b7a69f982..bfdf34dcffe 100644 --- a/crates/shared/src/lib.rs +++ b/crates/shared/src/lib.rs @@ -24,7 +24,6 @@ pub struct Program { #[derive(Deserialize, Serialize)] pub struct Import { pub module: Option, - pub version: Option, pub js_namespace: Option, pub kind: ImportKind, } diff --git a/crates/webidl-tests/build.rs b/crates/webidl-tests/build.rs index 2f8294b3af8..536ccf07c93 100644 --- a/crates/webidl-tests/build.rs +++ b/crates/webidl-tests/build.rs @@ -28,7 +28,7 @@ fn main() { use wasm_bindgen::prelude::*; use wasm_bindgen_test::*; - #[wasm_bindgen(module = "{}", version = "*")] + #[wasm_bindgen(module = "{}")] extern {{ fn not_actually_a_function{1}(); }} diff --git a/crates/webidl/src/lib.rs b/crates/webidl/src/lib.rs index 76e17669b8b..4cdb457fa3f 100644 --- a/crates/webidl/src/lib.rs +++ b/crates/webidl/src/lib.rs @@ -240,7 +240,6 @@ impl<'src> WebidlParse<'src, ()> for weedle::InterfaceDefinition<'src> { program.imports.push(backend::ast::Import { module: None, - version: None, js_namespace: None, kind: backend::ast::ImportKind::Type(backend::ast::ImportType { vis: public(), @@ -718,7 +717,6 @@ impl<'src> WebidlParse<'src, ()> for weedle::EnumDefinition<'src> { let variants = &self.values.body.list; program.imports.push(backend::ast::Import { module: None, - version: None, js_namespace: None, kind: backend::ast::ImportKind::Enum(backend::ast::ImportEnum { vis: public(), diff --git a/guide/src/design/import-customization.md b/guide/src/design/import-customization.md index 3db5a505753..4f1b6d9aa40 100644 --- a/guide/src/design/import-customization.md +++ b/guide/src/design/import-customization.md @@ -5,37 +5,6 @@ controlling precisely how imports are imported and what they map to in JS. This section is intended to hopefully be an exhaustive reference of the possibilities! -* `module` and `version` - we've seen `module` so far indicating where we can - import items from but `version` is also allowed: - - ```rust - #[wasm_bindgen(module = "moment", version = "^2.0.0")] - extern { - type Moment; - fn moment() -> Moment; - #[wasm_bindgen(method)] - fn format(this: &Moment) -> String; - } - ``` - - The `module` key is used to configure the module that each item is imported - from. The `version` key does not affect the generated wasm itself but rather - it's an informative directive for tools like [wasm-pack]. Tools like wasm-pack - will generate a `package.json` for you and the `version` listed here, when - `module` is also an NPM package, will correspond to what to write down in - `package.json`. - - In other words the usage of `module` as the name of an NPM package and - `version` as the version requirement allows you to, inline in Rust, depend on - the NPM ecosystem and import functionality from those packages. When bundled - with a tool like [wasm-pack] everything will automatically get wired up with - bundlers and you should be good to go! - - Note that the `version` is *required* if `module` doesn't start with `./`. If - `module` starts with `./` then it is an error to provide a version. - -[wasm-pack]: https://github.com/rustwasm/wasm-pack - * `catch` - this attribute allows catching a JS exception. This can be attached to any imported function and the function must return a `Result` where the `Err` payload is a `JsValue`, like so: diff --git a/tests/all/imports.rs b/tests/all/imports.rs deleted file mode 100644 index c290c3ec660..00000000000 --- a/tests/all/imports.rs +++ /dev/null @@ -1,52 +0,0 @@ -use super::project; - -#[test] -fn versions() { - project() - .debug(false) - .file( - "src/lib.rs", - r#" - #![feature(use_extern_macros)] - - extern crate wasm_bindgen; - - use wasm_bindgen::prelude::*; - - #[wasm_bindgen(module = "webpack", version = "^0.2.0")] - extern { - fn foo(); - } - - #[wasm_bindgen] - pub fn run() { - foo(); - } - "#, - ) - .file( - "test.js", - r#" - import * as fs from 'fs'; - import * as assert from 'assert'; - - export function test() { - const bytes = fs.readFileSync('out_bg.wasm'); - const m = new WebAssembly.Module(bytes); - const name = '__wasm_pack_unstable'; - const sections = WebAssembly.Module.customSections(m, name); - assert.strictEqual(sections.length, 1); - const b = new Uint8Array(sections[0]); - const buf = new Buffer(b); - const map = JSON.parse(buf.toString()); - assert.deepStrictEqual(map, { - version: '0.0.1', - modules: [ - ['webpack', '^0.2.0'] - ] - }); - }; - "#, - ) - .test(); -} diff --git a/tests/all/main.rs b/tests/all/main.rs index e31d286c44f..fecf2e1f0ce 100644 --- a/tests/all/main.rs +++ b/tests/all/main.rs @@ -5,5 +5,4 @@ extern crate wasm_bindgen_test_project_builder as project_builder; use project_builder::project; mod comments; -mod imports; mod typescript; diff --git a/tests/crates/a/src/lib.rs b/tests/crates/a/src/lib.rs index f3a4c04e213..04dde653583 100644 --- a/tests/crates/a/src/lib.rs +++ b/tests/crates/a/src/lib.rs @@ -4,7 +4,7 @@ extern crate wasm_bindgen; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] extern { fn foo(); } diff --git a/tests/crates/b/src/lib.rs b/tests/crates/b/src/lib.rs index 6d57e40497c..87f781da1ab 100644 --- a/tests/crates/b/src/lib.rs +++ b/tests/crates/b/src/lib.rs @@ -4,7 +4,7 @@ extern crate wasm_bindgen; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] extern { fn foo(x: u32); } diff --git a/tests/wasm/api.rs b/tests/wasm/api.rs index f7be28eaf08..1953929b4bf 100644 --- a/tests/wasm/api.rs +++ b/tests/wasm/api.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/api.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/api.js")] extern { fn js_works(); fn js_eq_works(); diff --git a/tests/wasm/char.rs b/tests/wasm/char.rs index 328151a8bb4..6d2ef325d36 100644 --- a/tests/wasm/char.rs +++ b/tests/wasm/char.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/char.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/char.js")] extern { fn js_identity(c: char) -> char; fn js_works(); diff --git a/tests/wasm/classes.rs b/tests/wasm/classes.rs index ae4bd2e2ab5..2c58c609508 100644 --- a/tests/wasm/classes.rs +++ b/tests/wasm/classes.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/classes.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/classes.js")] extern { fn js_simple(); fn js_strings(); diff --git a/tests/wasm/closures.rs b/tests/wasm/closures.rs index 2c9268662a2..84794725f96 100644 --- a/tests/wasm/closures.rs +++ b/tests/wasm/closures.rs @@ -3,7 +3,7 @@ use wasm_bindgen::prelude::*; use std::cell::Cell; use std::rc::Rc; -#[wasm_bindgen(module = "tests/wasm/closures.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/closures.js")] extern { fn works_call(a: &Fn()); fn works_thread(a: &Fn(u32) -> u32) -> u32; diff --git a/tests/wasm/duplicate_deps.rs b/tests/wasm/duplicate_deps.rs index d19e4134e74..0a451301743 100644 --- a/tests/wasm/duplicate_deps.rs +++ b/tests/wasm/duplicate_deps.rs @@ -3,7 +3,7 @@ use wasm_bindgen_test::*; use wasm_bindgen_test_crate_a as a; use wasm_bindgen_test_crate_b as b; -#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/duplicate_deps.js")] extern { fn assert_next_undefined(); fn assert_next_ten(); diff --git a/tests/wasm/duplicates.rs b/tests/wasm/duplicates.rs index c0beadad0c2..f35e6d3749f 100644 --- a/tests/wasm/duplicates.rs +++ b/tests/wasm/duplicates.rs @@ -3,7 +3,7 @@ use wasm_bindgen_test::*; pub mod same_function_different_locations_a { use wasm_bindgen::prelude::*; - #[wasm_bindgen(module = "tests/wasm/duplicates_a.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/duplicates_a.js")] extern { pub fn foo(); } @@ -12,7 +12,7 @@ pub mod same_function_different_locations_a { pub mod same_function_different_locations_b { use wasm_bindgen::prelude::*; - #[wasm_bindgen(module = "tests/wasm/duplicates_a.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/duplicates_a.js")] extern { pub fn foo(); } @@ -27,7 +27,7 @@ fn same_function_different_locations() { pub mod same_function_different_modules_a { use wasm_bindgen::prelude::*; - #[wasm_bindgen(module = "tests/wasm/duplicates_b.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/duplicates_b.js")] extern { pub fn foo() -> bool; } @@ -36,7 +36,7 @@ pub mod same_function_different_modules_a { pub mod same_function_different_modules_b { use wasm_bindgen::prelude::*; - #[wasm_bindgen(module = "tests/wasm/duplicates_c.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/duplicates_c.js")] extern { pub fn foo() -> bool; } diff --git a/tests/wasm/enums.rs b/tests/wasm/enums.rs index f49a18b951f..4c1ad2dcd00 100644 --- a/tests/wasm/enums.rs +++ b/tests/wasm/enums.rs @@ -2,7 +2,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; use self::inner::ColorWithCustomValues; -#[wasm_bindgen(module = "tests/wasm/enums.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/enums.js")] extern { fn js_c_style_enum(); fn js_c_style_enum_with_custom_values(); diff --git a/tests/wasm/import_class.rs b/tests/wasm/import_class.rs index 329e9e48e59..06083ea2c36 100644 --- a/tests/wasm/import_class.rs +++ b/tests/wasm/import_class.rs @@ -5,7 +5,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/import_class.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/import_class.js")] extern { fn math_log(f: f64) -> f64; diff --git a/tests/wasm/imports.rs b/tests/wasm/imports.rs index 731d24f72dc..1ad9208e93f 100644 --- a/tests/wasm/imports.rs +++ b/tests/wasm/imports.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/imports.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/imports.js")] extern { fn test_simple(); diff --git a/tests/wasm/js_objects.rs b/tests/wasm/js_objects.rs index 9c660492d38..70b3518e46d 100644 --- a/tests/wasm/js_objects.rs +++ b/tests/wasm/js_objects.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/js_objects.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/js_objects.js")] extern { fn simple_foo(s: &JsValue); fn js_simple(); diff --git a/tests/wasm/math.rs b/tests/wasm/math.rs index 47ea5ce2b95..413e8f2f510 100644 --- a/tests/wasm/math.rs +++ b/tests/wasm/math.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/math.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/math.js")] extern { fn js_auto_bind_math(); } @@ -64,4 +64,4 @@ pub fn math(a: f32, b: f64) -> f64 { #[wasm_bindgen_test] fn auto_bind_math() { js_auto_bind_math(); -} \ No newline at end of file +} diff --git a/tests/wasm/node.rs b/tests/wasm/node.rs index cee7986e18c..741febfccca 100644 --- a/tests/wasm/node.rs +++ b/tests/wasm/node.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/node.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/node.js")] extern { fn test_works(); static FOO: JsValue; diff --git a/tests/wasm/option.rs b/tests/wasm/option.rs index 98c7ece1258..8da01e3b9b1 100644 --- a/tests/wasm/option.rs +++ b/tests/wasm/option.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/option.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/option.js")] extern { pub type MyType; #[wasm_bindgen(constructor)] diff --git a/tests/wasm/optional_primitives.rs b/tests/wasm/optional_primitives.rs index 57a4bd1e01a..3543a4e2fdf 100644 --- a/tests/wasm/optional_primitives.rs +++ b/tests/wasm/optional_primitives.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/optional_primitives.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/optional_primitives.js")] extern { fn optional_i32_js_identity(a: Option) -> Option; fn optional_u32_js_identity(a: Option) -> Option; diff --git a/tests/wasm/simple.rs b/tests/wasm/simple.rs index d58f7ee144d..5182a3660fd 100644 --- a/tests/wasm/simple.rs +++ b/tests/wasm/simple.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/simple.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/simple.js")] extern { fn test_add(); fn test_string_arguments(); diff --git a/tests/wasm/slice.rs b/tests/wasm/slice.rs index 653ec01c9e8..6347a601562 100644 --- a/tests/wasm/slice.rs +++ b/tests/wasm/slice.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/slice.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/slice.js")] extern { fn js_export(); @@ -44,7 +44,7 @@ fn export() { macro_rules! import_macro { ($(($rust:ident, $js:ident, $i:ident))*) => ($( - #[wasm_bindgen(module = "tests/wasm/slice.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/slice.js")] extern { fn $js(a: &[$i]) -> Vec<$i>; } @@ -105,7 +105,7 @@ fn pass_array() { macro_rules! import_mut_macro { ($(($rust:ident, $js:ident, $i:ident))*) => ( $( - #[wasm_bindgen(module = "tests/wasm/slice.js", version = "*")] + #[wasm_bindgen(module = "tests/wasm/slice.js")] extern { fn $js(a: &mut [$i]); } diff --git a/tests/wasm/structural.rs b/tests/wasm/structural.rs index 92a13fe2b44..4729620c713 100644 --- a/tests/wasm/structural.rs +++ b/tests/wasm/structural.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/structural.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/structural.js")] extern { fn js_works(); } diff --git a/tests/wasm/u64.rs b/tests/wasm/u64.rs index d5d6076013c..1900d3cdbac 100644 --- a/tests/wasm/u64.rs +++ b/tests/wasm/u64.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/u64.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/u64.js")] extern { fn i64_js_identity(a: i64) -> i64; fn u64_js_identity(a: u64) -> u64; diff --git a/tests/wasm/validate_prt.rs b/tests/wasm/validate_prt.rs index f6446fde7bd..c04f3353c25 100644 --- a/tests/wasm/validate_prt.rs +++ b/tests/wasm/validate_prt.rs @@ -1,7 +1,7 @@ use wasm_bindgen_test::*; use wasm_bindgen::prelude::*; -#[wasm_bindgen(module = "tests/wasm/validate_prt.js", version = "*")] +#[wasm_bindgen(module = "tests/wasm/validate_prt.js")] extern { fn js_works(); }