mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-13 04:51:23 +00:00
web-sys: Add support for Global
-scope methods
This commit adds further support for the `Global` attribute to not only emit structural accessors but also emit functions that don't take `&self`. All methods on a `[Global]` interface will not require `&self` and will call functions and/or access properties on the global scope. This should enable things like: Window::location() // returns `Location` Window::fetch(...) // invokes the `fetch` function Closes #659
This commit is contained in:
@ -64,8 +64,7 @@ fn nullable_method() {
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
fn global_method() {
|
||||
let f = GlobalMethod::new().unwrap();
|
||||
assert_eq!(f.m(), 123);
|
||||
assert_eq!(GlobalMethod::m(), 123);
|
||||
}
|
||||
|
||||
#[wasm_bindgen_test]
|
||||
|
Reference in New Issue
Block a user