Skip to content

Commit 59c71ac

Browse files
committed
introduce emitCaseBlock function
1 parent efcf0e6 commit 59c71ac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/compiler/emitter.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3539,12 +3539,16 @@ module ts {
35393539
emit(node.expression);
35403540
endPos = emitToken(SyntaxKind.CloseParenToken, node.expression.end);
35413541
write(" ");
3542-
emitToken(SyntaxKind.OpenBraceToken, endPos);
3542+
emitCaseBlock(node.caseBlock, endPos)
3543+
}
3544+
3545+
function emitCaseBlock(node: CaseBlock, startPos: number): void {
3546+
emitToken(SyntaxKind.OpenBraceToken, startPos);
35433547
increaseIndent();
3544-
emitLines(node.caseBlock.clauses);
3548+
emitLines(node.clauses);
35453549
decreaseIndent();
35463550
writeLine();
3547-
emitToken(SyntaxKind.CloseBraceToken, node.caseBlock.clauses.end);
3551+
emitToken(SyntaxKind.CloseBraceToken, node.clauses.end);
35483552
}
35493553

35503554
function nodeStartPositionsAreOnSameLine(node1: Node, node2: Node) {

0 commit comments

Comments
 (0)