Skip to content

Commit cc38369

Browse files
Switch to Set of Symbols in extractSymbol.
1 parent ced38f3 commit cc38369

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/services/refactors/extractSymbol.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1597,7 +1597,7 @@ namespace ts.refactor.extractSymbol {
15971597
const functionErrorsPerScope: Diagnostic[][] = [];
15981598
const constantErrorsPerScope: Diagnostic[][] = [];
15991599
const visibleDeclarationsInExtractedRange: NamedDeclaration[] = [];
1600-
const exposedVariableSymbolSet = new Map<string, true>(); // Key is symbol ID
1600+
const exposedVariableSymbolSet = new Set<Symbol>(); // Key is symbol ID
16011601
const exposedVariableDeclarations: VariableDeclaration[] = [];
16021602
let firstExposedNonVariableDeclaration: NamedDeclaration | undefined;
16031603

@@ -1903,10 +1903,10 @@ namespace ts.refactor.extractSymbol {
19031903
const decl = find(visibleDeclarationsInExtractedRange, d => d.symbol === sym);
19041904
if (decl) {
19051905
if (isVariableDeclaration(decl)) {
1906-
const idString = decl.symbol.id!.toString();
1907-
if (!exposedVariableSymbolSet.has(idString)) {
1906+
const declSymbol = decl.symbol;
1907+
if (!exposedVariableSymbolSet.has(declSymbol)) {
19081908
exposedVariableDeclarations.push(decl);
1909-
exposedVariableSymbolSet.set(idString, true);
1909+
exposedVariableSymbolSet.add(declSymbol);
19101910
}
19111911
}
19121912
else {

0 commit comments

Comments
 (0)