Skip to content

Commit

Permalink
fix(codegen): add missing declare to PropertyDefinition (#4937)
Browse files Browse the repository at this point in the history
I'm seeing a broken test for

```rust
    #[test]
    fn dts_class_decl_prop_test() {
        transform_dts_test(
            "export class Foo { declare a: string }",
            "export declare class Foo {
  a: string;
}",
        );
    }
```

can you double check @Dunqing ?
  • Loading branch information
Boshen committed Aug 17, 2024
1 parent bea76f0 commit bbf9ec0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/oxc_codegen/src/gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2535,6 +2535,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for PropertyDefinition<'a> {
fn gen(&self, p: &mut Codegen<{ MINIFY }>, ctx: Context) {
p.add_source_mapping(self.span.start);
self.decorators.gen(p, ctx);
if self.declare {
p.print_str("declare ");
}
if let Some(accessibility) = &self.accessibility {
accessibility.gen(p, ctx);
}
Expand Down

0 comments on commit bbf9ec0

Please sign in to comment.