Skip to content

Commit 09a54fa

Browse files
fix(bindgen): error tag name
1 parent c6ee11a commit 09a54fa

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ impl Bindgen for FunctionBindgen<'_> {
859859
break;
860860
}}
861861
default: {{
862-
{debug_log_fn}("ERROR: invalid value (expected option as object with 'tag' member)", {{ value: variant{tmp} }});
862+
{debug_log_fn}("ERROR: invalid value (expected option as object with 'tag' member)", {{ value: variant{tmp}, valueType: typeof variant{tmp} }});
863863
throw new TypeError('invalid variant specified for option');
864864
}}
865865
}}"#,
@@ -974,7 +974,7 @@ impl Bindgen for FunctionBindgen<'_> {
974974
break;
975975
}}
976976
default: {{
977-
{debug_log_fn}("ERROR: invalid value (expected result as object with 'tag' member)", {{ value: variant{tmp} }});
977+
{debug_log_fn}("ERROR: invalid value (expected result as object with 'tag' member)", {{ value: variant{tmp}, valueType: typeof variant{tmp} }});
978978
throw new TypeError('invalid variant specified for result');
979979
}}
980980
}}"#,

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4754,7 +4754,7 @@ pub fn gen_flat_lift_fn_js_expr(
47544754

47554755
if let Some(err_ty) = &result_ty.err {
47564756
cases_and_lifts_expr.push_str(&format!(
4757-
"['error', {}, {}, {}, {}],",
4757+
"['err', {}, {}, {}, {}],",
47584758
gen_flat_lift_fn_js_expr(
47594759
intrinsic_mgr,
47604760
component_types,

0 commit comments

Comments
 (0)