mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-16 22:41:24 +00:00
Implement a polyfill
attribute for imports
Allow using imported APIs under alternative names, such as prefixed names, for web APIs when the exact API differs across browsers.
This commit is contained in:
@ -189,6 +189,7 @@ impl Bindgen {
|
||||
let mut cx = js::Context {
|
||||
globals: String::new(),
|
||||
imports: String::new(),
|
||||
imports_post: String::new(),
|
||||
footer: String::new(),
|
||||
typescript: format!("/* tslint:disable */\n"),
|
||||
exposed_globals: Default::default(),
|
||||
@ -208,6 +209,7 @@ impl Bindgen {
|
||||
js::SubContext {
|
||||
program,
|
||||
cx: &mut cx,
|
||||
polyfills: Default::default(),
|
||||
}.generate()?;
|
||||
}
|
||||
cx.finalize(stem)?
|
||||
|
Reference in New Issue
Block a user