From e03e1b97b6204ebbd430deb3d0d099b50a01e218 Mon Sep 17 00:00:00 2001 From: Guy Bedford Date: Mon, 28 Oct 2024 15:58:41 -0700 Subject: [PATCH] fix: optimized bindings codegen (#516) --- crates/js-component-bindgen/src/transpile_bindgen.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/js-component-bindgen/src/transpile_bindgen.rs b/crates/js-component-bindgen/src/transpile_bindgen.rs index 4ce493e38..eb1694ba4 100644 --- a/crates/js-component-bindgen/src/transpile_bindgen.rs +++ b/crates/js-component-bindgen/src/transpile_bindgen.rs @@ -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() ); }