Move element cache to the element[expando] to avoid cleanup and reduce code.
|Reported by:||Owned by:||Rick Waldron|
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.