Merge pull request #7951 from Microsoft/transforms-fix7896

[Transforms] Fixes detached comment emit for constructors
This commit is contained in:
Ron Buckton 2016-04-08 10:37:59 -07:00
commit 8db3ce2e44
2 changed files with 15 additions and 2 deletions

View File

@ -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) {

View File

@ -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
);
}