diff --git a/crates/js-sys/src/lib.rs b/crates/js-sys/src/lib.rs index 8af6e90065b..8647005e677 100644 --- a/crates/js-sys/src/lib.rs +++ b/crates/js-sys/src/lib.rs @@ -3561,6 +3561,34 @@ pub mod WebAssembly { pub fn set(this: &Table, index: u32, function: &Function) -> Result<(), JsValue>; } + // WebAssembly.Global + #[wasm_bindgen] + extern "C" { + /// The `WebAssembly.Global()` constructor creates a new `Global` object + /// of the given type and value. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) + #[wasm_bindgen(js_namespace = WebAssembly, extends = Object, typescript_type = "WebAssembly.Global")] + #[derive(Clone, Debug, PartialEq, Eq)] + pub type Global; + + /// The `WebAssembly.Global()` constructor creates a new `Global` object + /// of the given type and value. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) + #[wasm_bindgen(constructor, js_namespace = WebAssembly, catch)] + pub fn new(global_descriptor: &Object, value: &JsValue) -> Result; + + /// The value prototype property of the `WebAssembly.Global` object + /// returns the value of the global. + /// + /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WebAssembly/Global) + #[wasm_bindgen(method, getter, structural, js_namespace = WebAssembly)] + pub fn value(this: &Global) -> JsValue; + #[wasm_bindgen(method, setter = value, structural, js_namespace = WebAssembly)] + pub fn set_value(this: &Global, value: &JsValue); + } + // WebAssembly.Memory #[wasm_bindgen] extern "C" { diff --git a/crates/macro/ui-tests/async-errors.stderr b/crates/macro/ui-tests/async-errors.stderr index 20518ca833f..b6379812411 100644 --- a/crates/macro/ui-tests/async-errors.stderr +++ b/crates/macro/ui-tests/async-errors.stderr @@ -33,7 +33,7 @@ error[E0277]: the trait bound `wasm_bindgen::JsValue: From` is not sati > > > - and 62 others + and 63 others = note: required because of the requirements on the impl of `Into` for `BadType` = note: required because of the requirements on the impl of `IntoJsResult` for `BadType` = note: required by `into_js_result`