mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-13 21:11:22 +00:00
Don’t need catch for Module static methods
This commit is contained in:
@ -2961,22 +2961,22 @@ pub mod WebAssembly {
|
|||||||
/// string name.
|
/// string name.
|
||||||
///
|
///
|
||||||
/// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Module/customSections
|
/// 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)]
|
#[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly, js_name = customSections)]
|
||||||
pub fn custom_sections(module: &Module, sectionName: &str) -> Result<Array, JsValue>;
|
pub fn custom_sections(module: &Module, sectionName: &str) -> Array;
|
||||||
|
|
||||||
/// The `WebAssembly.exports()` function returns an array containing
|
/// The `WebAssembly.exports()` function returns an array containing
|
||||||
/// descriptions of all the declared exports of the given `Module`.
|
/// 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
|
/// 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)]
|
#[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly)]
|
||||||
pub fn exports(module: &Module) -> Result<Array, JsValue>;
|
pub fn exports(module: &Module) -> Array;
|
||||||
|
|
||||||
/// The `WebAssembly.imports()` function returns an array containing
|
/// The `WebAssembly.imports()` function returns an array containing
|
||||||
/// descriptions of all the declared imports of the given `Module`.
|
/// 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
|
/// 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)]
|
#[wasm_bindgen(static_method_of = Module, js_namespace = WebAssembly)]
|
||||||
pub fn imports(module: &Module) -> Result<Array, JsValue>;
|
pub fn imports(module: &Module) -> Array;
|
||||||
}
|
}
|
||||||
|
|
||||||
// WebAssembly.Table
|
// WebAssembly.Table
|
||||||
|
@ -76,21 +76,21 @@ fn module_inheritance() {
|
|||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
fn module_custom_sections() {
|
fn module_custom_sections() {
|
||||||
let module = WebAssembly::Module::new(&get_valid_wasm());
|
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);
|
assert_eq!(cust_sec.length(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
fn module_exports() {
|
fn module_exports() {
|
||||||
let module = WebAssembly::Module::new(&get_valid_wasm());
|
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);
|
assert_eq!(exports.length(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[wasm_bindgen_test]
|
#[wasm_bindgen_test]
|
||||||
fn module_imports() {
|
fn module_imports() {
|
||||||
let module = WebAssembly::Module::new(&get_valid_wasm());
|
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);
|
assert_eq!(imports.length(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user