Skip to content

Commit d5c2921

Browse files
tsjs-language-engcopybara-github
tsjs-language-eng
authored andcommitted
Don't include weak requires in the summary, if there's already a strong require for the same symbol.
PiperOrigin-RevId: 575860298
1 parent 0d47bd4 commit d5c2921

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/summary.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,12 @@ export class FileSummary {
8181
}
8282

8383
get weakRequires(): Symbol[] {
84-
return [...this.weakRequireSet.values()];
84+
const weakRequires = [];
85+
for (const [k, v] of this.weakRequireSet.entries()) {
86+
if (this.strongRequireSet.has(k)) continue;
87+
weakRequires.push(v);
88+
}
89+
return weakRequires;
8590
}
8691

8792
addDynamicRequire(dynamicRequire: Symbol) {

0 commit comments

Comments
 (0)