We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
CatchParameter
1 parent 297b2bb commit 9e4995cCopy full SHA for 9e4995c
crates/oxc_codegen/src/gen.rs
@@ -604,6 +604,11 @@ impl Gen for CatchClause<'_> {
604
p.print_soft_space();
605
p.print_ascii_byte(b'(');
606
param.pattern.print(p, ctx);
607
+ if let Some(type_annotation) = ¶m.type_annotation {
608
+ p.print_colon();
609
+ p.print_soft_space();
610
+ type_annotation.print(p, ctx);
611
+ }
612
p.print_ascii_byte(b')');
613
}
614
crates/oxc_codegen/tests/integration/ts.rs
@@ -36,6 +36,7 @@ fn cases() {
36
test_same("class E {\n\tsubscribe!: string;\n}\n");
37
test_same("class F {\n\taccessor value!: string;\n}\n");
38
test_same("export { type as as };\n");
39
+ test_same("try {} catch (e: unknown) {} finally {}\n");
40
41
42
#[test]
0 commit comments