mirror of
https://github.com/fluencelabs/wasm-bindgen
synced 2025-03-16 02:00:51 +00:00
Directly import __wrap
functions if possible
These can have similar optimizations as importing a value directly.
This commit is contained in:
parent
c22b907e7f
commit
6e8c3e88f8
@ -907,6 +907,9 @@ impl<'a, 'b> Rust2Js<'a, 'b> {
|
||||
assert!(!variadic);
|
||||
assert_eq!(self.js_arguments.len(), 1);
|
||||
self.cx.require_class_wrap(class);
|
||||
if self.is_noop() {
|
||||
return Ok(format!("{}.__wrap", class));
|
||||
}
|
||||
format!("{}.__wrap({})", class, self.js_arguments[0])
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user