fix(isolated_declarations): correct emit for private static methods (#4064)

This commit is contained in:
michaelm 2024-07-06 00:30:13 -04:00 committed by GitHub
parent 1681b11adb
commit 1b8f208572
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 11 additions and 1 deletions

View file

@ -142,6 +142,7 @@ impl<'a> IsolatedDeclarations<'a> {
&self,
r#type: PropertyDefinitionType,
key: PropertyKey<'a>,
r#static: bool,
r#override: bool,
accessibility: Option<TSAccessibility>,
) -> ClassElement<'a> {
@ -151,7 +152,7 @@ impl<'a> IsolatedDeclarations<'a> {
key,
None,
false,
false,
r#static,
false,
r#override,
false,
@ -205,6 +206,7 @@ impl<'a> IsolatedDeclarations<'a> {
self.create_class_property(
r#type,
self.ast.copy(&method.key),
method.r#static,
method.r#override,
self.transform_accessibility(method.accessibility),
)

View file

@ -22,6 +22,10 @@ export abstract class Qux {
export class Baz {
readonly prop1 = 'some string';
prop2 = 'another string';
private prop3 = 'yet another string';
private prop4(): void {}
private static prop5 = 'yet another string';
private static prop6(): void {}
}
export class Boo {

View file

@ -22,6 +22,10 @@ export declare abstract class Qux {
export declare class Baz {
readonly prop1: 'some string';
prop2: string;
private prop3;
private prop4;
private static prop5;
private static prop6;
}
export declare class Boo {
readonly prop: number;