Emit leading comment before brace token

This commit is contained in:
Kanchalai Tanglertsampan
2017-02-07 11:56:44 -08:00
parent 7fd404dbbc
commit 80eae169ee
20 changed files with 155 additions and 18 deletions

View File

@@ -1347,6 +1347,8 @@ namespace ts {
else {
writeToken(SyntaxKind.OpenBraceToken, node.pos, /*contextNode*/ node);
emitBlockStatements(node);
// We have to call emitLeadingComments explicitly here because otherwise leading comments of the close brace token will not be emitted
emitLeadingComments(node.statements.end, /*isEmittedNode*/true);
writeToken(SyntaxKind.CloseBraceToken, node.statements.end, /*contextNode*/ node);
}
}