fix(codegen): print definite property on AccessorProperty (#19786)

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

No files matched your search

+3
View File
@@ -2833,6 +2833,9 @@ impl Gen for AccessorProperty<'_> {
if self.computed {
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();
@@ -32,6 +32,7 @@ fn cases() {
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("class F {\n\taccessor value!: string;\n}\n");
test_same("export { type as as };\n");
}