From 1fc11aa18f4e8103b344492cba06b18e296b0401 Mon Sep 17 00:00:00 2001 From: Yui T Date: Thu, 8 Oct 2015 23:25:05 -0700 Subject: [PATCH] Address PR feedback, add comment --- src/compiler/emitter.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index a4ff544a132..2ebfe367d3c 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2591,6 +2591,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi } else { emit(node.left); + // Add indentation before emit the operator if the operator is on different line + // For example: + // 3 + // + 2; + // emitted as + // 3 + // + 2; let indentedBeforeOperator = indentIfOnDifferentLines(node, node.left, node.operatorToken, node.operatorToken.kind !== SyntaxKind.CommaToken ? " " : undefined); write(tokenToString(node.operatorToken.kind)); let indentedAfterOperator = indentIfOnDifferentLines(node, node.operatorToken, node.right, " ");