mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-19 11:40:51 +00:00
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
5 lines
108 B
JavaScript
5 lines
108 B
JavaScript
global.global_no_args = () => 3;
|
|
global.global_with_args = (a, b) => a + b;
|
|
global.global_attribute = 'x';
|
|
|