mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
fix(isolated-declarations): should print constructor assignments first (#5934)
This commit is contained in:
parent
4e9e838838
commit
ea32d5b156
3 changed files with 12 additions and 1 deletions
|
|
@ -402,7 +402,8 @@ impl<'a> IsolatedDeclarations<'a> {
|
||||||
};
|
};
|
||||||
|
|
||||||
if let MethodDefinitionKind::Constructor = method.kind {
|
if let MethodDefinitionKind::Constructor = method.kind {
|
||||||
elements.extend(
|
elements.splice(
|
||||||
|
0..0,
|
||||||
self.transform_constructor_params_to_class_properties(
|
self.transform_constructor_params_to_class_properties(
|
||||||
function, ¶ms,
|
function, ¶ms,
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -49,3 +49,8 @@ export class Bux {
|
||||||
readonly prop3: number = 1,
|
readonly prop3: number = 1,
|
||||||
) {}
|
) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class PrivateFieldsWithConstructorAssignments {
|
||||||
|
private second = 0;
|
||||||
|
constructor(public first: number) {}
|
||||||
|
}
|
||||||
|
|
@ -46,3 +46,8 @@ export declare class Bux {
|
||||||
readonly prop3: number;
|
readonly prop3: number;
|
||||||
private constructor();
|
private constructor();
|
||||||
}
|
}
|
||||||
|
export declare class PrivateFieldsWithConstructorAssignments {
|
||||||
|
first: number;
|
||||||
|
private second;
|
||||||
|
constructor(first: number);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue