Merge pull request #17919 from henrymercer/fix-empty-object-property-access

Fix property access on an object literal
This commit is contained in:
Ron Buckton
2017-09-20 19:06:04 -07:00
committed by GitHub
5 changed files with 77 additions and 5 deletions

View File

@@ -3941,11 +3941,10 @@ namespace ts {
return recreateOuterExpressions(expression, mutableCall, OuterExpressionKinds.PartiallyEmittedExpressions);
}
}
else {
const leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
if (leftmostExpressionKind === SyntaxKind.ObjectLiteralExpression || leftmostExpressionKind === SyntaxKind.FunctionExpression) {
return setTextRange(createParen(expression), expression);
}
const leftmostExpressionKind = getLeftmostExpression(emittedExpression).kind;
if (leftmostExpressionKind === SyntaxKind.ObjectLiteralExpression || leftmostExpressionKind === SyntaxKind.FunctionExpression) {
return setTextRange(createParen(expression), expression);
}
return expression;