mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-24 11:43:18 -05:00
Emit comments for if statement
This commit is contained in:
@@ -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(" ");
|
||||
|
||||
Reference in New Issue
Block a user