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