Skip to content

Commit 4364143

Browse files
chore(bindgen): fmt
1 parent 3621b2c commit 4364143

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

crates/js-component-bindgen/src/esm_bindgen.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ impl EsmBindgen {
396396
maybe_quote_member(specifier)
397397
);
398398
for (external_name, local_name) in bound_external_names {
399-
// For imports that are functions, ensure that they are noted as host provided
400-
uwriteln!(output, "{local_name}._isHostProvided = true;");
401-
402399
uwriteln!(
403400
output,
404401
r#"
@@ -409,6 +406,9 @@ impl EsmBindgen {
409406
}}
410407
"#,
411408
);
409+
410+
// For imports that are functions, ensure that they are noted as host provided
411+
uwriteln!(output, "{local_name}._isHostProvided = true;");
412412
}
413413
} else if let Some(idl_binding) = idl_binding {
414414
uwrite!(
@@ -480,9 +480,6 @@ impl EsmBindgen {
480480

481481
// Process all external host-provided imports
482482
for (member_name, local_name) in generated_member_names {
483-
// For imports that are functions, ensure that they are noted as host provided
484-
uwriteln!(output, "{local_name}._isHostProvided = true;");
485-
486483
// Ensure that the imports we destructured were defined
487484
// (if they were not, the user is likely missing an import @ instantiation time)
488485
uwriteln!(
@@ -495,6 +492,8 @@ impl EsmBindgen {
495492
}}
496493
"#,
497494
);
495+
// For imports that are functions, ensure that they are noted as host provided
496+
uwriteln!(output, "{local_name}._isHostProvided = true;");
498497
}
499498
}
500499
}

crates/js-component-bindgen/src/intrinsics/lower.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,14 +808,16 @@ impl LowerIntrinsic {
808808
let lower_flat_enum_fn = self.name();
809809
let lower_variant_fn = Self::LowerFlatVariant.name();
810810

811-
output.push_str(&format!("
811+
output.push_str(&format!(
812+
"
812813
function {lower_flat_enum_fn}(lowerMetas) {{
813814
return function {lower_flat_enum_fn}Inner(ctx) {{
814815
{debug_log_fn}('[{lower_flat_enum_fn}()] args', {{ ctx }});
815816
{lower_variant_fn}(lowerMetas)(ctx);
816817
}}
817818
}}
818-
"));
819+
"
820+
));
819821
}
820822

821823
Self::LowerFlatOption => {

0 commit comments

Comments
 (0)