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 for undefined this in event handlers #159

Merged
merged 2 commits into from
Jan 27, 2016
Merged

Conversation

davej
Copy link
Contributor

@davej davej commented Jan 27, 2016

this is not guaranteed to be defined in addEventListener. A third-party lib was adding an event in a strange way which gave me the following error Uncaught TypeError: Cannot read property '_' of undefined.

`this` is not guaranteed to be defined in `addEventListener`. A third-party lib was adding an event in a strange way which gave me the following error `Uncaught TypeError: Cannot read property '_' of undefined`.
@LeaVerou
Copy link
Owner

Thanks! You haven't added the check in removeEventListener though…

@davej
Copy link
Contributor Author

davej commented Jan 27, 2016

Oops, added!

LeaVerou added a commit that referenced this pull request Jan 27, 2016
Fix for undefined `this` in event handlers
@LeaVerou LeaVerou merged commit 2bc1cdf into LeaVerou:gh-pages Jan 27, 2016
@LeaVerou
Copy link
Owner

Merged, thanks!

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

2 participants