META: Define validity of plain JS objects for jQuery() and its methods
|Reported by:||dmethvin||Owned by:|
Description (last modified by ajpiano)
In the past a jQuery collection has mainly been DOM elements, with document or window allowed in some cases. We are starting to encourage wrapping plain JS objects in jQuery for purposes like pub/sub, and also seeing tickets like #7500 where people expect to use .attr() on plain JS objects.
We need to document the extent to which we support JS objects and decide the behavior of methods that don't accept JS objects. For example, $(obj).removeAttr("x") when used on a JS object currently sets the property to an empty string, it seems like the correct semantic action is to delete obj.x instead. BUT ... is it worth taking the size/performance/complexity hit to orthogonally handle something that is relatively rare?
PS, How does .data() differ from attr() on a plain object?
PPS, TEST CASES.
Change History (26)
comment:2 Changed 6 years ago by snover
- Component changed from unfiled to core
- Milestone changed from 1.next to 1.5
- Priority changed from undecided to blocker
- Status changed from new to open
comment:21 Changed 5 years ago by rwaldron
- Keywords needsdocs added; 1.7-discuss removed
- Milestone changed from 1.next to 1.6.1
- Priority changed from blocker to low
comment:25 Changed 5 years ago by timmywil
- Resolution set to fixed
- Status changed from open to closed