We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c9cb7fe commit 24ad88cCopy full SHA for 24ad88c
src/compiler/transformers/ts.ts
@@ -2239,8 +2239,16 @@ namespace ts {
2239
2240
function visitPropertyDeclaration(node: PropertyDeclaration): PropertyDeclaration | undefined {
2241
if (isPrivateName(node.name)) {
2242
- // Keep the private name declaration.
2243
- return node;
+ // Keep the private name declaration (without the initializer - which will be moved to the constructor).
+ return updateProperty(
2244
+ node,
2245
+ node.decorators,
2246
+ node.modifiers,
2247
+ node.name,
2248
+ node.questionToken,
2249
+ node.type,
2250
+ /*initializer*/ undefined
2251
+ );
2252
}
2253
const expr = getPropertyNameExpressionIfNeeded(node.name, some(node.decorators) || !!node.initializer, /*omitSimple*/ true);
2254
if (expr && !isSimpleInlineableExpression(expr)) {
0 commit comments