mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 18:43:44 +00:00
fix(codegen): print type annotation on CatchParameter (#19790)
This commit is contained in:
1 parent
297b2bbe10
commit
9e4995cd3d
2 files changed
+6
No files matched your search
@@ -604,6 +604,11 @@ impl Gen for CatchClause<'_> {
|
||||
p.print_soft_space();
|
||||
p.print_ascii_byte(b'(');
|
||||
param.pattern.print(p, ctx);
|
||||
if let Some(type_annotation) = ¶m.type_annotation {
|
||||
p.print_colon();
|
||||
p.print_soft_space();
|
||||
type_annotation.print(p, ctx);
|
||||
}
|
||||
p.print_ascii_byte(b')');
|
||||
}
|
||||
p.print_soft_space();
|
||||
|
||||
@@ -36,6 +36,7 @@ fn cases() {
|
||||
test_same("class E {\n\tsubscribe!: string;\n}\n");
|
||||
test_same("class F {\n\taccessor value!: string;\n}\n");
|
||||
test_same("export { type as as };\n");
|
||||
test_same("try {} catch (e: unknown) {} finally {}\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
Reference in new issue
Block a user