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 authored and GitHub committed 2017-09-20 19:06:04 -07:00
commit d9951cbb8e
5 files changed
+77 -5

No files matched your search

+4 -5
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;