From 19ee28d769b6e9bffc893e8114549dbf14c3c7a8 Mon Sep 17 00:00:00 2001 From: Frazer McLean Date: Mon, 20 Aug 2018 01:50:27 +0200 Subject: [PATCH] =?UTF-8?q?Don=E2=80=99t=20need=20catch=20for=20Module=20s?= =?UTF-8?q?tatic=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/js-sys/src/lib.rs | 12 ++++++------ crates/js-sys/tests/wasm/WebAssembly.rs | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index d9110259..106f181f 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -2961,22 +2961,22 @@ pub mod WebAssembly { /// string name. /// /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/customSections - #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly, js_name = customSections, catch)] - pub fn custom_sections(module: &Module, sectionName: &str) -> Result; + #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly, js_name = customSections)] + pub fn custom_sections(module: &Module, sectionName: &str) -> Array; /// The `WebAssembly.exports()` function returns an array containing /// descriptions of all the declared exports of the given `Module`. /// /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/exports - #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly, catch)] - pub fn exports(module: &Module) -> Result; + #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly)] + pub fn exports(module: &Module) -> Array; /// The `WebAssembly.imports()` function returns an array containing /// descriptions of all the declared imports of the given `Module`. /// /// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/imports - #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly, catch)] - pub fn imports(module: &Module) -> Result; + #[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly)] + pub fn imports(module: &Module) -> Array; } // WebAssembly.Table diff --git a/crates/js-sys/tests/wasm/WebAssembly.rs b/crates/js-sys/tests/wasm/WebAssembly.rs index 6a2a9cc3..6070720b 100644 --- a/crates/js-sys/tests/wasm/WebAssembly.rs +++ b/crates/js-sys/tests/wasm/WebAssembly.rs @@ -76,21 +76,21 @@ fn module_inheritance() { #[wasm_bindgen_test] fn module_custom_sections() { let module = WebAssembly::Module::new(&get_valid_wasm()); - let cust_sec = WebAssembly::Module::custom_sections(&module, "abcd").unwrap(); + let cust_sec = WebAssembly::Module::custom_sections(&module, "abcd"); assert_eq!(cust_sec.length(), 0); } #[wasm_bindgen_test] fn module_exports() { let module = WebAssembly::Module::new(&get_valid_wasm()); - let exports = WebAssembly::Module::exports(&module).unwrap(); + let exports = WebAssembly::Module::exports(&module); assert_eq!(exports.length(), 1); } #[wasm_bindgen_test] fn module_imports() { let module = WebAssembly::Module::new(&get_valid_wasm()); - let imports = WebAssembly::Module::imports(&module).unwrap(); + let imports = WebAssembly::Module::imports(&module); assert_eq!(imports.length(), 1); }