Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/oxc_isolated_declarations/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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> {
Expand All @@ -151,7 +152,7 @@ impl<'a> IsolatedDeclarations<'a> {
key,
None,
false,
false,
r#static,
false,
r#override,
false,
Expand Down Expand Up @@ -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),
)
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_isolated_declarations/tests/fixtures/class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 4 additions & 0 deletions crates/oxc_isolated_declarations/tests/snapshots/class.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Loading