mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-06-17 06:51:24 +00:00
Fix importing static
values of non-JS types
This hasn't ever actually worked in `wasm-bindgen` but there's been enough refactorings since the initial implementation that it's actually quite trivial to implement now! Closes #1777
This commit is contained in:
@ -1049,6 +1049,11 @@ impl<'a> Context<'a> {
|
||||
None => return Ok(()),
|
||||
};
|
||||
|
||||
let descriptor = match self.descriptors.remove(static_.shim) {
|
||||
None => return Ok(()),
|
||||
Some(d) => d,
|
||||
};
|
||||
|
||||
// Register the signature of this imported shim
|
||||
bindings::register_import(
|
||||
self.module,
|
||||
@ -1057,7 +1062,7 @@ impl<'a> Context<'a> {
|
||||
Function {
|
||||
arguments: Vec::new(),
|
||||
shim_idx: 0,
|
||||
ret: Descriptor::Anyref,
|
||||
ret: descriptor,
|
||||
},
|
||||
ast::WebidlFunctionKind::Static,
|
||||
)?;
|
||||
|
Reference in New Issue
Block a user