mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 20:41:24 +00:00
Rename static
to namespace
This commit renames the `static` attribute to `namespace` and simultaneously reduces and expands the scope. The `namespace` attribute can now be applied to all imports in addition to functions, and it no longer recognizes full typed paths but rather just a bare identifier. The `namespace` attribute will generate a Rust namespace to invoke the item through if one doesn't already exist (aka bindign a type).
This commit is contained in:
@ -6,9 +6,7 @@ use wasm_bindgen::prelude::*;
|
||||
|
||||
#[wasm_bindgen]
|
||||
extern {
|
||||
type console;
|
||||
|
||||
#[wasm_bindgen(static = console)]
|
||||
#[wasm_bindgen(namespace = console)]
|
||||
fn log(s: &str);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user