Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mgol merged 1 commit intojquery:masterfrommgol:event-object-prototype-collision
Mar 2, 2020

Conversation

mgol
Copy link
Member

@mgolmgol commentedFeb 5, 2020
edited
Loading

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:

  1. A check forevents in private data in.trigger() - only thehandle
    key is needed.
  2. A fallback of theevents private data to an empty object in
    jQuery.event.dispatch because that method is called from thehandle
    function in element's private data and bothevents &handle are set and
    removed at the same time.

Fixesgh-3256

Checklist

@mgol
Copy link
MemberAuthor

mgol commentedFeb 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.

@mgolmgolforce-pushed theevent-object-prototype-collision branch from70f64a0 to88ad53cCompareFebruary 10, 2020 18:19
@mgolmgolforce-pushed theevent-object-prototype-collision branch 2 times, most recently from6e47006 to06eb190CompareMarch 1, 2020 22:59
@mgol
Copy link
MemberAuthor

mgol commentedMar 1, 2020

Adding "Needs review" back as a few things have changed since I reported the PR.

It's now +0 bytes.

…pertiesMake sure events & data keys matching Object.prototype properties work.A separate fix for such events on cloned elements was added as well.Fixesjquerygh-3256
@mgolmgolforce-pushed theevent-object-prototype-collision branch from06eb190 to5145f8eCompareMarch 2, 2020 21:53
@mgolmgol merged commit9d76c0b intojquery:masterMar 2, 2020
@mgolmgol deleted the event-object-prototype-collision branchMarch 2, 2020 22:02
mgol added a commit that referenced this pull requestMar 2, 2020
Make sure events & data keys matching Object.prototype properties work.A separate fix for such events on cloned elements was added as well.Fixesgh-3256Closesgh-4603(cherry picked from commit9d76c0b)
mgol added a commit to mgol/jquery that referenced this pull requestApr 13, 2020
The change injquerygh-4603 made the object returned by `elem.data()` a prototype-lessobject. That's a desired change to support keys colliding with Object.prototypeproperties 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.Fixesjquerygh-4665Refjquerygh-4603
mgol added a commit that referenced this pull requestApr 20, 2020
The change ingh-4603 made the object returned by `elem.data()`a prototype-less object. That's a desired change to support keyscolliding with `Object.prototype` properties but it's also a breakingchange 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 thisbranch.Fixesgh-4665Refgh-4603Closesgh-4666
mgol added a commit to mgol/jquery that referenced this pull requestMar 30, 2023
This is a follow-up to similar changes to data & event storages fromjquerygh-4603.Refjquerygh-4603
mgol added a commit that referenced this pull requestApr 3, 2023
This is a follow-up to similar changes to data & event storages fromgh-4603.Closesgh-5235Refgh-4603
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dmethvindmethvindmethvin approved these changes

@timmywiltimmywiltimmywil approved these changes

@gibson042gibson042gibson042 approved these changes

Assignees

@mgolmgol

Milestone
3.5.0
Development

Successfully merging this pull request may close these issues.

Event types colliding with Object prototype properties don't work
4 participants
@mgol@dmethvin@timmywil@gibson042

[8]ページ先頭

©2009-2025 Movatter.jp