Skip to content

Commit 85485f9

Browse files
zombiesaschanaz
andauthoredFeb 12, 2025
Emit only instance members from global polluters (microsoft#1910)
Co-authored-by: saschanaz <[email protected]>
1 parent be2cad9 commit 85485f9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎src/build/emitter.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,8 @@ export function emitWebIdl(
803803
if (
804804
p.name === "name" &&
805805
i.name === "Window" &&
806-
emitScope === EmitScope.All
806+
emitScope === EmitScope.InstanceOnly &&
807+
prefix === "declare var "
807808
) {
808809
printer.printLine("/** @deprecated */");
809810
printer.printLine("declare const name: void;");
@@ -1064,7 +1065,7 @@ export function emitWebIdl(
10641065
/// Emit all members of every interfaces at the root level.
10651066
/// Called only once on the global polluter object
10661067
function emitAllMembers(i: Browser.Interface) {
1067-
emitMembers(/*prefix*/ "declare var ", EmitScope.All, i);
1068+
emitMembers(/*prefix*/ "declare var ", EmitScope.InstanceOnly, i);
10681069

10691070
for (const relatedIName of iNameToIDependList[i.name]) {
10701071
const i = allInterfacesMap[relatedIName];

0 commit comments

Comments
 (0)
Please sign in to comment.