File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
src/compiler/transformers Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -2239,8 +2239,16 @@ namespace ts {
2239
2239
2240
2240
function visitPropertyDeclaration ( node : PropertyDeclaration ) : PropertyDeclaration | undefined {
2241
2241
if ( isPrivateName ( node . name ) ) {
2242
- // Keep the private name declaration.
2243
- return node ;
2242
+ // Keep the private name declaration (without the initializer - which will be moved to the constructor).
2243
+ return updateProperty (
2244
+ node ,
2245
+ node . decorators ,
2246
+ node . modifiers ,
2247
+ node . name ,
2248
+ node . questionToken ,
2249
+ node . type ,
2250
+ /*initializer*/ undefined
2251
+ ) ;
2244
2252
}
2245
2253
const expr = getPropertyNameExpressionIfNeeded ( node . name , some ( node . decorators ) || ! ! node . initializer , /*omitSimple*/ true ) ;
2246
2254
if ( expr && ! isSimpleInlineableExpression ( expr ) ) {
You can’t perform that action at this time.
0 commit comments