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 {
22392239
22402240 function visitPropertyDeclaration ( node : PropertyDeclaration ) : PropertyDeclaration | undefined {
22412241 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+ ) ;
22442252 }
22452253 const expr = getPropertyNameExpressionIfNeeded ( node . name , some ( node . decorators ) || ! ! node . initializer , /*omitSimple*/ true ) ;
22462254 if ( expr && ! isSimpleInlineableExpression ( expr ) ) {
You can’t perform that action at this time.
0 commit comments