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

Remove cached references to Node constructor #2472

Open
ekashida opened this issue Aug 26, 2021 · 0 comments
Open

Remove cached references to Node constructor #2472

ekashida opened this issue Aug 26, 2021 · 0 comments
Labels
Synthetic Shadow Synthetic shadow DOM polyfill

Comments

@ekashida
Copy link
Member

This issue provides context for why we cache Node references along with guidance on when we can remove the related code.

There is legacy code in the platform, for which the owning team is unknown, that sets window.Node to null during the unload event, presumably to deal with IE memory leaks. When LWC component authors subsequently invoked certain polyfilled DOM APIs (e.g., composedPath(), event.target, etc) during the unload event, it caused instanceof Node checks to throw exceptions. Rather than taking on the deceptively monumental task of removing that line of code, we decided to simply cache the Node reference internally.

These changes can be safely removed when SfdcInitialize.js is updated to remove the window.Node = null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Synthetic Shadow Synthetic shadow DOM polyfill
Projects
None yet
Development

No branches or pull requests

2 participants