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:
Alex Crichton
2018-03-21 09:55:16 -07:00
parent dd054fa357
commit 4a4f8b18b6
9 changed files with 267 additions and 176 deletions

View File

@ -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);
}