Skip to content

Commit ced38f3

Browse files
Same trick for symbol.id, and always set it to 0.
1 parent f9d2db3 commit ced38f3

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/compiler/checker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,13 @@ namespace ts {
287287
}
288288

289289
export function getSymbolId(symbol: Symbol): SymbolId {
290-
if (!symbol.id) {
291-
symbol.id = nextSymbolId;
290+
let id = symbol.id;
291+
if (!id) {
292+
symbol.id = id = nextSymbolId;
292293
nextSymbolId++;
293294
}
294295

295-
return symbol.id;
296+
return id;
296297
}
297298

298299
export function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean) {

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4900,7 +4900,7 @@ namespace ts {
49004900
members?: SymbolTable; // Class, interface or object literal instance members
49014901
exports?: SymbolTable; // Module exports
49024902
globalExports?: SymbolTable; // Conditional global UMD exports
4903-
/* @internal */ id?: SymbolId; // Unique id (used to look up SymbolLinks)
4903+
/* @internal */ id: SymbolId; // Unique id (used to look up SymbolLinks)
49044904
/* @internal */ mergeId?: number; // Merge id (used to look up merged symbol)
49054905
/* @internal */ parent?: Symbol; // Parent symbol
49064906
/* @internal */ exportSymbol?: Symbol; // Exported symbol associated with this symbol

src/compiler/utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5798,7 +5798,7 @@ namespace ts {
57985798
this.escapedName = name;
57995799
this.declarations = undefined;
58005800
this.valueDeclaration = undefined;
5801-
this.id = undefined;
5801+
this.id = 0;
58025802
this.mergeId = undefined;
58035803
this.parent = undefined;
58045804
}

0 commit comments

Comments
 (0)