Skip to content

Commit c24df57

Browse files
author
Joey Watts
committed
Fix property name to include PrivateNames
Signed-off-by: Joey Watts <[email protected]>
1 parent 5f22f66 commit c24df57

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/compiler/checker.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -10105,7 +10105,7 @@ namespace ts {
1010510105
return false;
1010610106
}
1010710107

10108-
function getPropertyNameFromIndex(indexType: Type, accessNode: StringLiteral | Identifier | ObjectBindingPattern | ArrayBindingPattern | ComputedPropertyName | NumericLiteral | IndexedAccessTypeNode | ElementAccessExpression | SyntheticExpression | undefined) {
10108+
function getPropertyNameFromIndex(indexType: Type, accessNode: StringLiteral | Identifier | ObjectBindingPattern | ArrayBindingPattern | ComputedPropertyName | NumericLiteral | IndexedAccessTypeNode | ElementAccessExpression | SyntheticExpression | PrivateName | undefined) {
1010910109
const accessExpression = accessNode && accessNode.kind === SyntaxKind.ElementAccessExpression ? accessNode : undefined;
1011010110
return isTypeUsableAsPropertyName(indexType) ?
1011110111
getPropertyNameFromType(indexType) :

src/compiler/utilities.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6277,7 +6277,8 @@ namespace ts {
62776277
return kind === SyntaxKind.Identifier
62786278
|| kind === SyntaxKind.StringLiteral
62796279
|| kind === SyntaxKind.NumericLiteral
6280-
|| kind === SyntaxKind.ComputedPropertyName;
6280+
|| kind === SyntaxKind.ComputedPropertyName
6281+
|| kind === SyntaxKind.PrivateName;
62816282
}
62826283

62836284
export function isBindingName(node: Node): node is BindingName {

0 commit comments

Comments
 (0)