Skip to content

Commit aa96475

Browse files
CR feedback.
1 parent 1a4299e commit aa96475

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/compiler/emitter.ts

+7
Original file line numberDiff line numberDiff line change
@@ -3033,6 +3033,9 @@ module ts {
30333033
return false;
30343034
}
30353035

3036+
// Returns 'true' if the code was actually indented, false otherwise.
3037+
// If the code is not indented, an optional valueToWriteWhenNotIndenting will be
3038+
// emitted instead.
30363039
function indentIfOnDifferentLines(parent: Node, node1: Node, node2: Node, valueToWriteWhenNotIndenting?: string) {
30373040
var realNodesAreOnDifferentLines = preserveNewLines && !nodeIsSynthesized(parent) && !nodeEndIsOnSameLineAsNodeStart(node1, node2);
30383041

@@ -3321,6 +3324,10 @@ module ts {
33213324
decreaseIndentIf(indentedBeforeColon, indentedAfterColon);
33223325
}
33233326

3327+
// Helper function to decrease the indent if we previously indented. Allows multiple
3328+
// previous indent values to be considered at a time. This also allows caller to just
3329+
// call this once, passing in all their appropriate indent values, instead of needing
3330+
// to call this helper function multiple times.
33243331
function decreaseIndentIf(value1: boolean, value2?: boolean) {
33253332
if (value1) {
33263333
decreaseIndent();

0 commit comments

Comments
 (0)