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

Removes the extra argument from removeEventListener #6052

Closed
wants to merge 1 commit into from
Closed

Removes the extra argument from removeEventListener #6052

wants to merge 1 commit into from

Conversation

sebiniemann
Copy link
Contributor

Fixes #5303

@sebiniemann sebiniemann changed the title Removed the extra argument from removeEventListener and merges eventListenerOptions into addEventListener Removes the extra argument from removeEventListener and merges eventListenerOptions into addEventListener Feb 7, 2019
@sebiniemann sebiniemann changed the title Removes the extra argument from removeEventListener and merges eventListenerOptions into addEventListener Removes the extra argument from removeEventListener Feb 7, 2019
@simonbrunel
Copy link
Member

The line to impact to address #5303 would be the call to removeResizeListener, but this has already been fixed in #5970. And according the MDN, removeEventListener takes 3 arguments, the last one recommended to be the same as the one used in addEventListener:

It's worth noting that some browser releases have been inconsistent on this, and unless you have specific reasons otherwise, it's probably wise to use the same values used for the call to addEventListener() when calling removeEventListener()

@simonbrunel simonbrunel closed this Feb 8, 2019
@sebiniemann sebiniemann deleted the patch-2 branch February 8, 2019 07:16
@kurkle
Copy link
Member

kurkle commented Feb 8, 2019

I'm not sure we should have altered the code just if a analyzer says so. Does SonarQube know every implementation of removeEventListener that's in the wild (or even those we are targeting)? I'd trust MDN on this.

@sebiniemann
Copy link
Contributor Author

@simonbrunel Good catch, thanks

@simonbrunel
Copy link
Member

@kurkle SonarQube didn't report an issue with removeEventListener but with the call of our own removeResizeListener method, which indeed doesn't accept 2 arguments.

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

Successfully merging this pull request may close these issues.

None yet

5 participants