Skip to content

Commit

Permalink
Don't include weak requires in the summary, if there's already a stro…
Browse files Browse the repository at this point in the history
…ng require for the same symbol.

PiperOrigin-RevId: 575860298
  • Loading branch information
tsjs-language-eng authored and copybara-github committed Oct 23, 2023
1 parent 0d47bd4 commit d5c2921
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ export class FileSummary {
}

get weakRequires(): Symbol[] {
return [...this.weakRequireSet.values()];
const weakRequires = [];
for (const [k, v] of this.weakRequireSet.entries()) {
if (this.strongRequireSet.has(k)) continue;
weakRequires.push(v);
}
return weakRequires;
}

addDynamicRequire(dynamicRequire: Symbol) {
Expand Down

0 comments on commit d5c2921

Please sign in to comment.