-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
all of the following must be true: window.window === window globalThis.window === globalThis globalThis.self === globalThis.window
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this 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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
This PR ensures all of the following are true after calling
Window.setGlobal(window)
: