Merge pull request #4641 from vilic/cast-expression-parentheses-with-numeric-literal

Do not omit parentheses for numeric literal with ".property" if it can not be followed by dot operator directly.
This commit is contained in:
Daniel Rosenwasser
2015-09-10 12:14:49 -07:00
5 changed files with 122 additions and 11 deletions

View File

@@ -2354,7 +2354,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
operand.kind !== SyntaxKind.PostfixUnaryExpression &&
operand.kind !== SyntaxKind.NewExpression &&
!(operand.kind === SyntaxKind.CallExpression && node.parent.kind === SyntaxKind.NewExpression) &&
!(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression)) {
!(operand.kind === SyntaxKind.FunctionExpression && node.parent.kind === SyntaxKind.CallExpression) &&
!(operand.kind === SyntaxKind.NumericLiteral && node.parent.kind === SyntaxKind.PropertyAccessExpression)) {
emit(operand);
return;
}