nw_sys/
global.rs

1use js_sys::Object;
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen]
5extern "C" {
6    type Global;
7
8    #[wasm_bindgen(getter, static_method_of = Global, js_class = global, js_name = global)]
9    fn get_global() -> Object;
10
11    #[wasm_bindgen(getter, static_method_of = Global, js_class = globalThis, js_name = globalThis)]
12    fn get_global_this() -> Object;
13}
14
15pub fn global() -> Object {
16    Global::get_global()
17}
18
19pub fn global_this() -> Object {
20    Global::get_global_this()
21}