-
Notifications
You must be signed in to change notification settings - Fork 20.6k
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
Event types colliding with Object prototype properties don't work #3256
Comments
Why not |
I thought we still supported environments where that fails, but things look good! 👍 |
Yup, and the changes required in that case will be smaller. :) I'm only not sure if PhantomJS 1.x supports Object.create. |
I've just rediscovered this bug. Is there a reason this hasn't been fixed yet? |
No one has yet gotten around to it. But a pull request would be welcome! |
I think we can implement the easy fix with spaces immediately, then consider using Map in 4.0. |
…perties Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. The commit also removes two unnecessary checks: 1. A check for `events` in private data in `.trigger()` - only the `handle` key is needed. 2. A fallback of the `events` private data to an empty object in `jQuery.event.dispatch` because that method is called from the `handle` function in element's private data and both `events` & `handle` are set and removed at the same time. Fixes jquerygh-3256
PR: #4603. I also fixed similar issues in manipulation & data modules using |
…perties Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. The commit also removes two unnecessary checks: 1. A check for `events` in private data in `.trigger()` - only the `handle` key is needed. 2. A fallback of the `events` private data to an empty object in `jQuery.event.dispatch` because that method is called from the `handle` function in element's private data and both `events` & `handle` are set and removed at the same time. Fixes jquerygh-3256
…perties Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. The commit also removes a fallback of the `events` private data to an empty object in `jQuery.event.dispatch` because that method is called from the `handle` function in element's private data and both `events` & `handle` are set and removed at the same time. Fixes jquerygh-3256
…perties Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. Fixes jquerygh-3256
…perties Make sure events & data keys matching Object.prototype properties work. A separate fix for such events on cloned elements was added as well. Fixes jquerygh-3256
In my opinion this is a breaking change that should not go into 3.5.0 minor upgrade version. It can break a lot of dependent projects, like this one: snapappointments/bootstrap-select#2430 |
@rjaros Please submit a new issue with details. |
I've changed the milestone from |
We use
event.type
as a key to get the array of event handlers, which throws an exception when we instead receive anObject.prototype
property and treat it like an array: https://jsfiddle.net/9t4kqaqr/Our standard fix is appending a space (cf. delegated selector match tracking and Sizzle
createCache
), but we should also considerMap
for such purposes (ponyfilling as needed), especially if Data.js can be updated accordingly—one of @rwaldron's original goals when creating it.The text was updated successfully, but these errors were encountered: