Opened 10 years ago
Last modified 9 years ago
#8921 closed enhancement
jQuery private data should — at Version 9
Reported by: | gnarf | Owned by: | gnarf |
---|---|---|---|
Priority: | blocker | Milestone: | 1.7 |
Component: | data | Version: | git |
Keywords: | 1.7-discuss | Cc: | |
Blocked by: | Blocking: |
Description (last modified by )
It seems that the "private" data is ALWAYS stored on the .data(jQuery.expando)
- For "objects" where the deletion of the object should also delete its caches this makes some sense.
In the realm of nodes however, I think we should store these "private" members in a separate (private) cache so that they don't pollute the object returned by $.fn.data()
Change History (9)
comment:1 Changed 10 years ago by
Component: | unfiled → data |
---|---|
Owner: | set to gnarf |
Status: | new → assigned |
comment:2 Changed 10 years ago by
Keywords: | 1.7-discuss added |
---|
comment:4 Changed 10 years ago by
+1, I know the code would probably grow (I'm not so sure but heh) but I think it makes a lot of sense
comment:6 Changed 10 years ago by
Description: | modified (diff) |
---|
The reason I ran into the issue in the first place was that I changed the .data()
behavior to store a flag in private data stopping it from scanning all the data- attribs more than once. Then a bunch of unit tests broke becuase it was using the jQuery.expando
key on the .data()
-- Basically, anytime you wanted to for ... in
the .data()
you're going to need to "ignore" the "private" data....
comment:7 Changed 10 years ago by
+1, I was thinking the same, worth considering with the "attach data to DOM elements" rewrite if it can be done
comment:8 Changed 10 years ago by
Priority: | undecided → high |
---|
comment:9 Changed 10 years ago by
Description: | modified (diff) |
---|
+0, Don't really have strong feelings on this.
Nominating ticket for 1.7 discussion.