Emit comments for if statement

This commit is contained in:
Sheetal Nandi
2014-08-15 15:32:43 -07:00
parent 6036c92784
commit 0a75cc2926
6 changed files with 5 additions and 5 deletions

View File

@@ -924,10 +924,6 @@ module ts {
}
function emitIfStatement(node: IfStatement) {
// emit comments only if this is not else if statement as else if will take care of emitting the leading/trailing comments
if (node.parent.kind !== SyntaxKind.IfStatement || (<IfStatement>node.parent).elseStatement !== node) {
emitLeadingComments(node);
}
emitLeadingComments(node);
var endPos = emitToken(SyntaxKind.IfKeyword, node.pos);
write(" ");
@@ -937,7 +933,6 @@ module ts {
emitEmbeddedStatement(node.thenStatement);
if (node.elseStatement) {
writeLine();
emitLeadingComments(node.elseStatement);
emitToken(SyntaxKind.ElseKeyword, node.thenStatement.end);
if (node.elseStatement.kind === SyntaxKind.IfStatement) {
write(" ");