fix(codegen): print definite property on PropertyDefinition (#19785)

This commit is contained in:
camc314 committed 2026-02-27 08:28:12 +00:00
1 parent b74937317b
commit 6f395cff26
2 files changed
+4

No files matched your search

+3
View File
@@ -2780,6 +2780,9 @@ impl Gen for PropertyDefinition<'_> {
if self.optional {
p.print_ascii_byte(b'?');
}
if self.definite {
p.print_ascii_byte(b'!');
}
if let Some(type_annotation) = &self.type_annotation {
p.print_colon();
p.print_soft_space();
@@ -31,6 +31,7 @@ fn cases() {
test_same("class B {\n\tconstructor(override readonly a: number) {}\n}\n");
test_same("class C extends B {\n\toverride show(): void;\n\toverride hide(): void;\n}\n");
test_same("class D extends B {\n\toverride readonly x: number;\n}\n");
test_same("class E {\n\tsubscribe!: string;\n}\n");
test_same("export { type as as };\n");
}