mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-18 23:41:24 +00:00
Add #[wasm_bindgen(assert_no_shim)]
on imported functions for testing
This should not be used outside of wasm-bindgen's test suite.
This commit is contained in:
@ -163,6 +163,7 @@ pub struct WasmBindgenAux {
|
||||
/// Small bits of metadata about imports.
|
||||
pub imports_with_catch: HashSet<ImportId>,
|
||||
pub imports_with_variadic: HashSet<ImportId>,
|
||||
pub imports_with_assert_no_shim: HashSet<ImportId>,
|
||||
|
||||
/// Auxiliary information to go into JS/TypeScript bindings describing the
|
||||
/// exported enums from Rust.
|
||||
@ -793,6 +794,7 @@ impl<'a> Context<'a> {
|
||||
method,
|
||||
structural,
|
||||
function,
|
||||
assert_no_shim,
|
||||
} = function;
|
||||
let (import_id, _id) = match self.function_imports.get(*shim) {
|
||||
Some(pair) => *pair,
|
||||
@ -811,6 +813,9 @@ impl<'a> Context<'a> {
|
||||
if *catch {
|
||||
self.aux.imports_with_catch.insert(import_id);
|
||||
}
|
||||
if *assert_no_shim {
|
||||
self.aux.imports_with_assert_no_shim.insert(import_id);
|
||||
}
|
||||
|
||||
// Perform two functions here. First we're saving off our WebIDL
|
||||
// bindings signature, indicating what we think our import is going to
|
||||
|
Reference in New Issue
Block a user