Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Window.setGlobal): window aliases should refer to globalThis #470

Merged
merged 4 commits into from
Oct 29, 2024

Conversation

developit
Copy link
Contributor

@developit developit commented Oct 19, 2024

This PR ensures all of the following are true after calling Window.setGlobal(window):

window.window === window
globalThis.window === globalThis
globalThis.self === globalThis.window

developit and others added 2 commits October 18, 2024 21:30
all of the following must be true:
window.window === window
globalThis.window === globalThis
globalThis.self === globalThis.window
@henrytao-me henrytao-me marked this pull request as ready for review October 23, 2024 12:59

This comment has been minimized.

Copy link
Member

@henrytao-me henrytao-me left a comment

Choose a reason for hiding this comment

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

🎩-ed. LGTM

[ONCE_LISTENERS]?: WeakMap<EventListenerOrEventListenerObject, EventListener>;
[LISTENERS]:
| Map<string, Set<EventListenerOrEventListenerObject>>
| undefined = undefined;
Copy link
Contributor

Choose a reason for hiding this comment

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

Needed to set these to undefined so undefined is copied over in setGlobal

Copy link
Contributor

Choose a reason for hiding this comment

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

These could just be set to maps, but I assumed that was being avoided for performance reasons?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants