Skip to content

Commit 489a01b

Browse files
committed
PR feedback
1 parent 5d4ba79 commit 489a01b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4123,15 +4123,15 @@ namespace ts {
41234123
if (context.tracker.trackSymbol && getCheckFlags(propertySymbol) & CheckFlags.Late) {
41244124
const decl = first(propertySymbol.declarations);
41254125
if (hasLateBindableName(decl)) {
4126-
if (!isBinaryExpression(decl)) {
4127-
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
4128-
}
4129-
else {
4126+
if (isBinaryExpression(decl)) {
41304127
const name = getNameOfDeclaration(decl);
41314128
if (name && isElementAccessExpression(name) && isPropertyAccessEntityNameExpression(name.argumentExpression)) {
41324129
trackComputedName(name.argumentExpression, saveEnclosingDeclaration, context);
41334130
}
41344131
}
4132+
else {
4133+
trackComputedName(decl.name.expression, saveEnclosingDeclaration, context);
4134+
}
41354135
}
41364136
}
41374137
const propertyName = symbolToName(propertySymbol, context, SymbolFlags.Value, /*expectsIdentifier*/ true);

src/compiler/utilities.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2074,7 +2074,10 @@ namespace ts {
20742074
return AssignmentDeclarationKind.None;
20752075
}
20762076

2077-
// TODO: Signed numeric literals?
2077+
/**
2078+
* Does not handle signed numeric names like `a[+0]` - handling those would require handling prefix unary expressions
2079+
* throughout late binding handling as well, which is awkward (but ultimately probably doable if there is demand)
2080+
*/
20782081
/* @internal */
20792082
export function getElementOrPropertyAccessArgumentExpressionOrName(node: PropertyAccessExpression | ElementAccessExpression): Identifier | StringLiteralLike | NumericLiteral | ElementAccessExpression | undefined {
20802083
if (isPropertyAccessExpression(node)) {

0 commit comments

Comments
 (0)