mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 20:37:00 -05:00
Merge pull request #7951 from Microsoft/transforms-fix7896
[Transforms] Fixes detached comment emit for constructors
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user