fix(isolated-declarations): should print constructor assignments first (#5934)

This commit is contained in:
Dunqing 2024-09-21 07:52:51 +00:00
parent 4e9e838838
commit ea32d5b156
3 changed files with 12 additions and 1 deletions

View file

@ -402,7 +402,8 @@ impl<'a> IsolatedDeclarations<'a> {
};
if let MethodDefinitionKind::Constructor = method.kind {
elements.extend(
elements.splice(
0..0,
self.transform_constructor_params_to_class_properties(
function, &params,
),

View file

@ -49,3 +49,8 @@ export class Bux {
readonly prop3: number = 1,
) {}
}
export class PrivateFieldsWithConstructorAssignments {
private second = 0;
constructor(public first: number) {}
}

View file

@ -46,3 +46,8 @@ export declare class Bux {
readonly prop3: number;
private constructor();
}
export declare class PrivateFieldsWithConstructorAssignments {
first: number;
private second;
constructor(first: number);
}