New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow dynamic names in types #15473

merged 65 commits into from Nov 16, 2017
Jump to file or symbol
Failed to load files and symbols.
+4 −12
Diff settings


Just for now

Viewing a subset of changes. View all

PR feedback

  • Loading branch information...
rbuckton committed May 2, 2017
commit 3b684d420fc3c62d0589eac7e785e373f51d9197
@@ -5186,24 +5186,16 @@ namespace ts {
case SyntaxKind.ClassDeclaration:
case SyntaxKind.ClassExpression:
case SyntaxKind.TypeLiteral:
resolveDynamicMembersOfClassOrInterfaceOrTypeLiteralNode(<ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode>node, symbolTable);
resolveDynamicMembersOfNode(node, (<ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode>node).members, symbolTable);
case SyntaxKind.ObjectLiteralExpression:
resolveDynamicMembersOfObjectLiteralExpression(<ObjectLiteralExpression>node, symbolTable);
resolveDynamicMembersOfNode(node, (<ObjectLiteralExpression>node).properties, symbolTable);
function resolveDynamicMembersOfClassOrInterfaceOrTypeLiteralNode(node: ClassLikeDeclaration | InterfaceDeclaration | TypeLiteralNode, symbolTable: SymbolTable) {
for (const member of node.members) {
if ( && isComputedPropertyName( && isEntityNameExpression( {
bindDynamicMember(symbolTable, node.symbol, member);
function resolveDynamicMembersOfObjectLiteralExpression(node: ObjectLiteralExpression, symbolTable: SymbolTable) {
for (const member of {
function resolveDynamicMembersOfNode(node: Declaration, members: NodeArray<ClassElement | TypeElement | ObjectLiteralElement>, symbolTable: SymbolTable) {
for (const member of members) {

This comment has been minimized.


sandersn May 2, 2017


it would be simpler to have a third parameter symbol and only one resolveDynamicMembersOfNode(members: NodeArray<ClassElement | TypeElement | ObjectLiteralElementLike>, symbols: Symbol[], symbolTable: SymbolTable). Then resolveDynamicMembersOfSymbol could pull off the properties of node in each case.

if ( && isComputedPropertyName( && isEntityNameExpression( {
bindDynamicMember(symbolTable, node.symbol, member);
ProTip! Use n and p to navigate between commits in a pull request.