META: Define validity of plain JS objects for jQuery() and its methods
|Reported by:||dmethvin||Owned by:|
Description (last modified by )
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
|Component:||unfiled → core|
|Milestone:||1.next → 1.5|
|Priority:||undecided → blocker|
|Status:||new → open|
comment:21 Changed 6 years ago by
|Keywords:||needsdocs added; 1.7-discuss removed|
|Milestone:||1.next → 1.6.1|
|Priority:||blocker → low|