Ticket #11570 (open feature)
Move element cache to the element[expando] to avoid cleanup and reduce code.
|Reported by:||john.david.dalton@…||Owned by:||rwaldron|
Soo way back in 2005 Dean Edwards proposed an event system that slapped the listeners on the actual element. This allowed cache to be destroyed once the element was GC'ed. http://dean.edwards.name/weblog/2005/10/add-event2/
Over the weekend Peter Michaux proposed a similar solution: https://twitter.com/#!/petermichaux/status/189012245483757568 https://github.com/petermichaux/evento/blob/bd065a9b254a8d14b956ec438dc06c29622c3ef6/src/eventTarget.js#L165
I noticed that jQuery supports events on vanilla objects too so this change would align elements and objects.
The gist is that since jQuery is already adding an expando for a UID they can just use that property as the actual storage for the element.
Then all the code to recursively clean .removed'ed elements event/custom data could be removed as when the element is GC'ed that data is destroyed.
- Owner set to rwaldron
- Status changed from new to assigned
- Priority changed from undecided to low
- Component changed from unfiled to event
- Status changed from assigned to closed
- Resolution set to fixed
comment:17 Changed 4 weeks ago by rwaldron
- Status changed from closed to reopened
- Resolution fixed deleted
- Milestone 2.0 deleted