Skip to content

Commit

Permalink
fix: optimized bindings codegen (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
guybedford authored Oct 28, 2024
1 parent d9f3557 commit e03e1b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions crates/js-component-bindgen/src/transpile_bindgen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1244,15 +1244,15 @@ impl<'a> Instantiator<'a, '_> {
let symbol_cabi_lower = self.gen.intrinsic(Intrinsic::SymbolCabiLower);
if !self.gen.opts.valid_lifting_optimization {
uwriteln!(self.src.js_init, "if (!{callee_name}[{symbol_cabi_lower}]) {{
throw new TypeError('import for \"{import_name}\" does not define a Symbol.for('cabiLower') optimized binding');
throw new TypeError('import for \"{import_name}\" does not define a Symbol.for(\"cabiLower\") optimized binding');
}}");
}
uwriteln!(self.src.js_init, "trampoline{} = {callee_name}[{symbol_cabi_lower}]({memory}{realloc}{post_return}{string_encoding}{resource_tables});", trampoline.as_u32());
uwriteln!(self.src.js_init, "trampoline{} = {callee_name}[{symbol_cabi_lower}]({{{memory}{realloc}{post_return}{string_encoding}{resource_tables}}});", trampoline.as_u32());
}
Some(BindingsMode::DirectOptimized) => {
uwriteln!(
self.src.js_init,
"trampoline{} = {callee_name}({memory}{realloc}{post_return}{string_encoding});",
"trampoline{} = {callee_name}({{{memory}{realloc}{post_return}{string_encoding}}});",
trampoline.as_u32()
);
}
Expand Down

0 comments on commit e03e1b9

Please sign in to comment.