mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-28 07:51:07 +00:00
This information is embedded within the algorithm for constructing interfaces and their prototypes in the section for ECMAScript glue in the WebIDL spec... This really *should* make the `wasm_bindgen_backend::ast::ImportType::extends` member from a `Vec<Ident>` into a `Vec<syn::Path>` so that we could use `js_sys::Object` in the extends field, but that is a huge pain because then the `ImportedTypes` trait needs to be changed, and all of its implementers, etc...
14 lines
374 B
Rust
14 lines
374 B
Rust
use js_sys::Object;
|
|
use wasm_bindgen_test::*;
|
|
|
|
include!(concat!(env!("OUT_DIR"), "/global.rs"));
|
|
|
|
#[wasm_bindgen_test]
|
|
fn works() {
|
|
assert_eq!(Global::global_no_args(), 3);
|
|
assert_eq!(Global::global_with_args("a", "b"), "ab");
|
|
assert_eq!(Global::global_attribute(), "x");
|
|
Global::set_global_attribute("y");
|
|
assert_eq!(Global::global_attribute(), "y");
|
|
}
|