mirror of
https://github.com/oxc-project/oxc.git
synced 2026-11-04 10:29:58 +00:00
fix(codegen): print definite property on PropertyDefinition (#19785)
This commit is contained in:
1 parent
b74937317b
commit
6f395cff26
2 files changed
+4
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user