mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-12 12:31:22 +00:00
Merge branch 'node-math' of https://github.com/ashleygwilliams/wasm-bindgen
This commit is contained in:
@ -337,10 +337,17 @@ impl<'a> Context<'a> {
|
||||
|
||||
let mut globals = &mut self.globals;
|
||||
let renamed_import = format!("__wbindgen_{}", import.field());
|
||||
let node = self.config.nodejs;
|
||||
let mut bind_math = |expr: &str| {
|
||||
globals.push_str(&format!("
|
||||
export function {}{}
|
||||
", renamed_import, expr));
|
||||
if node {
|
||||
globals.push_str(&format!("
|
||||
exports.{} = function{};
|
||||
", renamed_import, expr));
|
||||
} else {
|
||||
globals.push_str(&format!("
|
||||
export function {}{}
|
||||
", renamed_import, expr));
|
||||
}
|
||||
};
|
||||
|
||||
// FIXME(#32): try to not use function shims
|
||||
|
Reference in New Issue
Block a user