Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,13 @@ namespace ts {
ExportNamespace = 1 << 2,
}

function SymbolLinks(this: SymbolLinks) {
}

function NodeLinks(this: NodeLinks) {
this.flags = 0;
}

export function getNodeId(node: Node): number {
if (!node.id) {
node.id = nextNodeId;
Expand Down Expand Up @@ -1255,12 +1262,12 @@ namespace ts {
function getSymbolLinks(symbol: Symbol): SymbolLinks {
if (symbol.flags & SymbolFlags.Transient) return <TransientSymbol>symbol;
const id = getSymbolId(symbol);
Comment thread
Swatinem marked this conversation as resolved.
Outdated
return symbolLinks[id] || (symbolLinks[id] = {});
return symbolLinks[id] || (symbolLinks[id] = new (<any>SymbolLinks)());
}

function getNodeLinks(node: Node): NodeLinks {
const nodeId = getNodeId(node);
return nodeLinks[nodeId] || (nodeLinks[nodeId] = { flags: 0 } as NodeLinks);
return nodeLinks[nodeId] || (nodeLinks[nodeId] = new (<any>NodeLinks)());
}

function isGlobalSourceFile(node: Node) {
Expand Down