Skip to content

Commit

Permalink
Emit only instance members from global polluters (#1910)
Browse files Browse the repository at this point in the history
Co-authored-by: saschanaz <saschanaz@users.noreply.github.com>
  • Loading branch information
zombie and saschanaz authored Feb 12, 2025
1 parent be2cad9 commit 85485f9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/build/emitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,8 @@ export function emitWebIdl(
if (
p.name === "name" &&
i.name === "Window" &&
emitScope === EmitScope.All
emitScope === EmitScope.InstanceOnly &&
prefix === "declare var "
) {
printer.printLine("/** @deprecated */");
printer.printLine("declare const name: void;");
Expand Down Expand Up @@ -1064,7 +1065,7 @@ export function emitWebIdl(
/// Emit all members of every interfaces at the root level.
/// Called only once on the global polluter object
function emitAllMembers(i: Browser.Interface) {
emitMembers(/*prefix*/ "declare var ", EmitScope.All, i);
emitMembers(/*prefix*/ "declare var ", EmitScope.InstanceOnly, i);

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

0 comments on commit 85485f9

Please sign in to comment.