@@ -13371,17 +13371,27 @@ namespace ts {
13371
13371
case SyntaxKind.EnumDeclaration:
13372
13372
copySymbols(getSymbolOfNode(location).exports, meaning & SymbolFlags.EnumMember);
13373
13373
break;
13374
+ case SyntaxKind.ClassExpression:
13375
+ let className = (<ClassExpression>location).name;
13376
+ if (className) {
13377
+ copySymbol(className.text, location.symbol, meaning);
13378
+ }
13379
+ // fall through; this fall-through is necessary because we would like to handle
13380
+ // type parameter inside class expression similar to how we handle it in classDeclaration and interface Declaration
13374
13381
case SyntaxKind.ClassDeclaration:
13375
13382
case SyntaxKind.InterfaceDeclaration:
13383
+ // If we didn't come from static member of class or interface, add the type parameters into the symbol table
13384
+ // (type parameters of classDeclaration/classExpression and interface are in member property of the symbol.
13385
+ // jNote: that the memberFlags come from previous iteration.
13376
13386
if (!(memberFlags & NodeFlags.Static)) {
13377
13387
copySymbols(getSymbolOfNode(location).members, meaning & SymbolFlags.Type);
13378
13388
}
13379
13389
break;
13380
13390
case SyntaxKind.FunctionExpression:
13381
13391
case SyntaxKind.ClassExpression:
13382
- let name = (<FunctionExpression|ClassExpression >location).name;
13383
- if (name ) {
13384
- copySymbol(name .text, location.symbol, meaning);
13392
+ let funcName = (<FunctionExpression>location).name;
13393
+ if (funcName ) {
13394
+ copySymbol(funcName .text, location.symbol, meaning);
13385
13395
}
13386
13396
break;
13387
13397
}
@@ -13396,7 +13406,7 @@ namespace ts {
13396
13406
/**
13397
13407
* Copy the given symbol into symbol tables if the symbol has the given meaning
13398
13408
* and it doesn't already existed in the symbol table
13399
- * @param key a key for storing in symbol table; if null , use symbol.name
13409
+ * @param key a key for storing in symbol table; if undefined , use symbol.name
13400
13410
* @param symbol the symbol to be added into symbol table
13401
13411
* @param meaning meaning of symbol to filter by before adding to symbol table
13402
13412
*/
0 commit comments