diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 237f3ab509ae7..f3e45a85b6a08 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -2117,7 +2117,8 @@ module ts { * or equal precedence to the binary '+' operator */ function comparePrecedenceToBinaryPlus(expression: Expression): Comparison { - // All binary expressions have lower precedence than '+' apart from '*', '/', and '%'. + // All binary expressions have lower precedence than '+' apart from '*', '/', and '%' + // which have greater precedence and '-' which has equal precedence. // All unary operators have a higher precedence apart from yield. // Arrow functions and conditionals have a lower precedence, // although we convert the former into regular function expressions in ES5 mode, @@ -2134,6 +2135,7 @@ module ts { case SyntaxKind.PercentToken: return Comparison.GreaterThan; case SyntaxKind.PlusToken: + case SyntaxKind.MinusToken: return Comparison.EqualTo; default: return Comparison.LessThan;