diff --git a/crates/oxc_codegen/src/gen.rs b/crates/oxc_codegen/src/gen.rs index 5c81b7b647d39..9191cd1f62978 100644 --- a/crates/oxc_codegen/src/gen.rs +++ b/crates/oxc_codegen/src/gen.rs @@ -766,6 +766,11 @@ impl Gen for FormalParameter<'_> { p.print_str(accessibility.as_str()); p.print_soft_space(); } + if self.r#override { + p.print_space_before_identifier(); + p.print_str("override"); + p.print_soft_space(); + } if self.readonly { p.print_space_before_identifier(); p.print_str("readonly"); diff --git a/crates/oxc_codegen/tests/integration/ts.rs b/crates/oxc_codegen/tests/integration/ts.rs index 9a751c1b53507..2f1c908979aa5 100644 --- a/crates/oxc_codegen/tests/integration/ts.rs +++ b/crates/oxc_codegen/tests/integration/ts.rs @@ -14,6 +14,7 @@ fn cases() { test_same( "class Foo {\n\t#name: string;\n\tf() {\n\t\t#name in other && this.#name === other.#name;\n\t}\n}\n", ); + test_same("class B {\n\tconstructor(override readonly a: number) {}\n}\n"); } #[test]