-
Notifications
You must be signed in to change notification settings - Fork 134
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
🐛 Use EventTarget.prototype.addEventListener instead of the method #3137
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3137 +/- ##
==========================================
- Coverage 93.69% 93.26% -0.44%
==========================================
Files 279 280 +1
Lines 7680 7673 -7
Branches 1717 1718 +1
==========================================
- Hits 7196 7156 -40
- Misses 484 517 +33 ☔ View full report in Codecov by Sentry. |
const addEventListenerSpy = jasmine.createSpy() | ||
const removeEventListenerSpy = jasmine.createSpy() | ||
|
||
// The stopLeakDetection function of the global after each hook will reset the EventTarget.prototype.addEventListener |
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.
The addEventListener override conflicts with the leakDetection. The best way I found is to let the stopLeakDetection remove the override
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
Motivation
Use the window.EventTarget.prototype when possible to avoid wrong overrides (e.g: salesforce/lwc#1824)
Changes
browser-sdk/packages/core/src/browser/addEventListener.ts
Lines 131 to 132 in 91bace6
Testing
I have gone over the contributing documentation.