-
Notifications
You must be signed in to change notification settings - Fork 20.6k
Data:Event:Manipulation: Prevent collisions with Object.prototype properties #4603
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
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mgol
commented
Feb 5, 2020
mgol
commented
Feb 5, 2020
-19 bytes because of removals of fallbacks where they didn't seem needed IMO. I'd appreciate a review of those cases to be sure. |
dmethvin
approved these changes
Feb 5, 2020
70f64a0
to
88ad53c
Compare
gibson042
approved these changes
Feb 17, 2020
6e47006
to
06eb190
Compare
Adding "Needs review" back as a few things have changed since I reported the PR. It's now +0 bytes. |
gibson042
approved these changes
Mar 2, 2020
timmywil
approved these changes
Mar 2, 2020
…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
06eb190
to
5145f8e
Compare
mgol
added a commit
to mgol/jquery
that referenced
this pull request
Apr 13, 2020
The change in jquerygh-4603 made the object returned by `elem.data()` a prototype-less object. That's a desired change to support keys colliding with Object.prototype properties but it's also a breaking change so it has to wait for jQuery 4.0.0. A 3.x-only test was added to avoid breaking it in the future on this branch. Fixes jquerygh-4665 Ref jquerygh-4603
4 tasks
mgol
added a commit
that referenced
this pull request
Apr 20, 2020
The change in gh-4603 made the object returned by `elem.data()` a prototype-less object. That's a desired change to support keys colliding with `Object.prototype` properties but it's also a breaking change so it has to wait for jQuery 4.0.0. A 3.x-only test was added to avoid breaking it in the future on this branch. Fixes gh-4665 Ref gh-4603 Closes gh-4666
mgol
added a commit
to mgol/jquery
that referenced
this pull request
Mar 30, 2023
This is a follow-up to similar changes to data & event storages from jquerygh-4603. Ref jquerygh-4603
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
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:
events
in private data in.trigger()
- only thehandle
key is needed.
events
private data to an empty object injQuery.event.dispatch
because that method is called from thehandle
function in element's private data and both
events
&handle
are set andremoved at the same time.
Fixes gh-3256
Checklist
.data()
returns an object with anull
prototype since4.0.0
api.jquery.com#1259)