diff --git a/src/compiler/transformers/es6.ts b/src/compiler/transformers/es6.ts index f93c69b8d69..82b60cf8a08 100644 --- a/src/compiler/transformers/es6.ts +++ b/src/compiler/transformers/es6.ts @@ -735,7 +735,14 @@ namespace ts { } addRange(statements, endLexicalEnvironment()); - return createBlock(statements, /*location*/ constructor && constructor.body, /*multiLine*/ true); + return createBlock( + createNodeArray( + statements, + /*location*/ constructor ? constructor.body.statements : undefined + ), + /*location*/ constructor ? constructor.body : undefined, + /*multiLine*/ true + ); } function transformConstructorBodyWithSynthesizedSuper(node: ConstructorDeclaration) { diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index a2fc0b56763..0b8c11a66e2 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -829,7 +829,13 @@ namespace ts { // End the lexical environment. addNodes(statements, endLexicalEnvironment()); return setMultiLine( - createBlock(statements, constructor ? constructor.body : undefined), + createBlock( + createNodeArray( + statements, + /*location*/ constructor ? constructor.body.statements : undefined + ), + /*location*/ constructor ? constructor.body : undefined + ), true ); }