1
0
mirror of https://github.com/fluencelabs/wasm-bindgen synced 2025-06-21 00:36:33 +00:00

Merge pull request from fitzgen/no-import-shims

Skip generating JS import shims when unnecessary
This commit is contained in:
Nick Fitzgerald
2019-07-15 10:13:11 -07:00
committed by GitHub
12 changed files with 315 additions and 18 deletions
crates
backend
cli-support
macro-support
shared
webidl
tests/wasm

@ -52,6 +52,9 @@ macro_rules! attrgen {
(typescript_custom_section, TypescriptCustomSection(Span)),
(start, Start(Span)),
(skip, Skip(Span)),
// For testing purposes only.
(assert_no_shim, AssertNoShim(Span)),
}
};
}
@ -495,8 +498,10 @@ impl<'a> ConvertToAst<(BindgenAttrs, &'a ast::ImportModule)> for syn::ForeignIte
return Err(Diagnostic::span_error(*span, msg));
}
}
let assert_no_shim = opts.assert_no_shim().is_some();
let ret = ast::ImportKind::Function(ast::ImportFunction {
function: wasm,
assert_no_shim,
kind,
js_ret,
catch,