@@ -90,8 +90,11 @@ namespace ts {
9090 case SyntaxKind . ComputedPropertyName :
9191 return visitComputedPropertyName ( node as ComputedPropertyName ) ;
9292
93- default :
93+ case SyntaxKind . SemicolonClassElement :
9494 return node ;
95+
96+ default :
97+ return visitor ( node ) ;
9598 }
9699 }
97100
@@ -138,28 +141,30 @@ namespace ts {
138141 if ( ! forEach ( node . members , isPropertyDeclaration ) ) {
139142 return visitEachChild ( node , visitor , context ) ;
140143 }
144+
141145 const savedPendingExpressions = pendingExpressions ;
142- pendingExpressions = undefined ;
146+ pendingExpressions = undefined ! ;
143147
144148 const extendsClauseElement = getEffectiveBaseTypeNode ( node ) ;
145149 const isDerivedClass = ! ! ( extendsClauseElement && skipOuterExpressions ( extendsClauseElement . expression ) . kind !== SyntaxKind . NullKeyword ) ;
146150
147151 const statements : Statement [ ] = [
148152 updateClassDeclaration (
149153 node ,
150- node . decorators ,
154+ /* decorators*/ undefined ,
151155 node . modifiers ,
152156 node . name ,
153- node . typeParameters ,
154- node . heritageClauses ,
157+ /* typeParameters*/ undefined ,
158+ visitNodes ( node . heritageClauses , visitor , isHeritageClause ) ,
155159 transformClassMembers ( node , isDerivedClass )
156160 )
157161 ] ;
158162
159163 // Write any pending expressions from elided or moved computed property names
160164 if ( some ( pendingExpressions ) ) {
161- statements . push ( createExpressionStatement ( inlineExpressions ( pendingExpressions ! ) ) ) ;
165+ statements . push ( createExpressionStatement ( inlineExpressions ( pendingExpressions ) ) ) ;
162166 }
167+
163168 pendingExpressions = savedPendingExpressions ;
164169
165170 // Emit static property assignment. Because classDeclaration is lexically evaluated,
@@ -199,7 +204,7 @@ namespace ts {
199204 node ,
200205 node . modifiers ,
201206 node . name ,
202- node . typeParameters ,
207+ /* typeParameters*/ undefined ,
203208 visitNodes ( node . heritageClauses , visitor , isHeritageClause ) ,
204209 transformClassMembers ( node , isDerivedClass )
205210 ) ;
@@ -329,6 +334,21 @@ namespace ts {
329334 // this.x = 1;
330335 // }
331336 //
337+ if ( constructor && constructor . body ) {
338+ let parameterPropertyDeclarationCount = 0 ;
339+ for ( let i = indexOfFirstStatement ; i < constructor . body . statements . length ; i ++ ) {
340+ if ( isParameterPropertyDeclaration ( getOriginalNode ( constructor . body . statements [ i ] ) ) ) {
341+ parameterPropertyDeclarationCount ++ ;
342+ }
343+ else {
344+ break ;
345+ }
346+ }
347+ if ( parameterPropertyDeclarationCount > 0 ) {
348+ addRange ( statements , visitNodes ( constructor . body . statements , visitor , isStatement , indexOfFirstStatement , parameterPropertyDeclarationCount ) ) ;
349+ indexOfFirstStatement += parameterPropertyDeclarationCount ;
350+ }
351+ }
332352 addInitializedPropertyStatements ( statements , properties , createThis ( ) ) ;
333353
334354 // Add existing statements, skipping the initial super call.
0 commit comments