mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-16 15:45:27 -05:00
Merge pull request #17919 from henrymercer/fix-empty-object-property-access
Fix property access on an object literal
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user