Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Need to reset currentAffectedFilesExportedModulesMap after commiting …
…to final exports map
  • Loading branch information
sheetalkamat committed Apr 6, 2022
commit 3ac922671dd73a042205d3b1d4dad5eea558d9e3
1 change: 1 addition & 0 deletions src/compiler/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,7 @@ namespace ts {
BuilderState.updateSignaturesFromCache(state, state.currentAffectedFilesSignatures!);
state.currentAffectedFilesSignatures!.clear();
BuilderState.updateExportedFilesMapFromCache(state, state.currentAffectedFilesExportedModulesMap);
state.currentAffectedFilesExportedModulesMap?.clear();
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this got missed when we first introduced currentAffectedFilesExportedModulesMap.. Look how we clear currentAffectedFilesSignatures just above..

state.affectedFiles = undefined;
}

Expand Down
10 changes: 8 additions & 2 deletions src/compiler/builderState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ namespace ts {
export interface ManyToManyPathMap extends ReadonlyManyToManyPathMap {
deleteKey(k: Path): boolean;
set(k: Path, v: ReadonlySet<Path>): void;
clear(): void;
}

export function createManyToManyPathMap(): ManyToManyPathMap {
Expand Down Expand Up @@ -144,6 +145,11 @@ namespace ts {

return map;
},
clear: () => {
forward.clear();
reverse.clear();
deleted?.clear();
}
};

return map;
Expand All @@ -161,11 +167,11 @@ namespace ts {
set.add(v);
}

function deleteFromMultimap<K, V>(map: ESMap<K, Set<V>>, k: K, v: V, removeEmpty = true): boolean {
function deleteFromMultimap<K, V>(map: ESMap<K, Set<V>>, k: K, v: V): boolean {
const set = map.get(k);

if (set?.delete(v)) {
if (removeEmpty && !set.size) {
if (!set.size) {
map.delete(k);
}
return true;
Expand Down