Ticket #11570 (closed feature: migrated)
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.
- 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 2 years ago by rwaldron
- Status changed from closed to reopened
- Resolution fixed deleted
- Milestone 2.0 deleted
comment:18 Changed 2 years ago by dmethvin
- Status changed from reopened to open
- Milestone set to 1.11/2.1
comment:19 Changed 21 months ago by jzaefferer
comment:22 Changed 17 months ago by dmethvin
- Component changed from event to data
- Milestone changed from 1.next/2.next to 1.12/2.2