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

Data: Patch camelCase behavior of $.fn.data, warn about Object.prototype #559

Merged
merged 1 commit into from
Mar 3, 2025

Conversation

mgol
Copy link
Member

@mgol mgol commented Jan 10, 2025

NOTE: Right now, this PR includes PR #554; only review the commit titled "Data: Patch camelCase behavior of $.fn.data, warn about Object.prototype". This PR should not be merged before #554; that's the only reason it's in a draft state.

Changes:

  1. Patch not only jQuery.data(), but also jQuery.fn.data().
  2. Patch jQuery.removeData() & jQuery.fn.removeData() to work in most cases
    when different keys with the same camelCase representation were passed to
    the data setter and later to removeData.
  3. Warn about using properties inherited from Object.prototype on data
    objects.

@mgol mgol added this to the 3.6.0 milestone Jan 10, 2025
@mgol mgol self-assigned this Jan 10, 2025
@mgol
Copy link
Member Author

mgol commented Jan 10, 2025

@mgol mgol force-pushed the 3.x-data branch 4 times, most recently from fdfb5a6 to 69a9d03 Compare January 14, 2025 11:56
mgol added a commit to mgol/jquery-migrate that referenced this pull request Jan 14, 2025

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
mgol added a commit to mgol/jquery-migrate that referenced this pull request Jan 14, 2025

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
mgol added a commit to mgol/jquery-migrate that referenced this pull request Feb 2, 2025

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
mgol added a commit to mgol/jquery-migrate that referenced this pull request Feb 17, 2025

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
@mgol mgol marked this pull request as ready for review February 18, 2025 00:08

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
Changes:
1. Patch not only `jQuery.data()`, but also `jQuery.fn.data()`.
2. Patch `jQuery.removeData()` & `jQuery.fn.removeData()` to work in most cases
   when different keys with the same camelCase representation were passed to
   the data setter and later to `removeData`.
3. Warn about using properties inherited from `Object.prototype` on data
   objects.
mgol added a commit to mgol/jquery-migrate that referenced this pull request Feb 18, 2025

Verified

This commit was signed with the committer’s verified signature.
mgol Michał Gołębiowski-Owczarek
@mgol mgol removed the Needs review label Mar 3, 2025
mgol added a commit that referenced this pull request Mar 3, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Closes gh-561
Ref gh-559
@mgol mgol merged commit 2c286d1 into jquery:3.x-stable Mar 3, 2025
9 checks passed
@mgol mgol deleted the 3.x-data branch March 3, 2025 17:19
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.

Warn about accessing props from Object.prototype in .data()/jQuery.event.special
2 participants