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

Open
wants to merge 1 commit into
base: 3.x-stable
Choose a base branch
from

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

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant