Skip to content

Commit b01e4d8

Browse files
author
Yui T
committed
Address code review
1 parent 7c52aaa commit b01e4d8

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/compiler/checker.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13381,7 +13381,7 @@ namespace ts {
1338113381
case SyntaxKind.ClassExpression:
1338213382
let name = (<FunctionExpression|ClassExpression>location).name;
1338313383
if (name) {
13384-
copySymbol(location.symbol, meaning, name.text);
13384+
copySymbol(name.text, location.symbol, meaning);
1338513385
}
1338613386
break;
1338713387
}
@@ -13396,12 +13396,11 @@ namespace ts {
1339613396
/**
1339713397
* Copy the given symbol into symbol tables if the symbol has the given meaning
1339813398
* and it doesn't already existed in the symbol table
13399-
*
13399+
* @param key a key for storing in symbol table; if null, use symbol.name
1340013400
* @param symbol the symbol to be added into symbol table
1340113401
* @param meaning meaning of symbol to filter by before adding to symbol table
13402-
* @param key a key for storing in symbol table; if null, use symbol.name
1340313402
*/
13404-
function copySymbol(symbol: Symbol, meaning: SymbolFlags, key?: string): void {
13403+
function copySymbol(key: string, symbol: Symbol, meaning: SymbolFlags): void {
1340513404
if (symbol.flags & meaning) {
1340613405
let id = key || symbol.name;
1340713406
if (!hasProperty(symbols, id)) {
@@ -13413,7 +13412,8 @@ namespace ts {
1341313412
function copySymbols(source: SymbolTable, meaning: SymbolFlags): void {
1341413413
if (meaning) {
1341513414
for (let id in source) {
13416-
copySymbol(source[id], meaning);
13415+
let symbol = source[id];
13416+
copySymbol(symbol.name, symbol, meaning);
1341713417
}
1341813418
}
1341913419
}

0 commit comments

Comments
 (0)