id,summary,reporter,owner,description,type,status,priority,milestone,component,version,resolution,keywords,cc,blocking,blockedby
7840,Element data cache is not cleared on removeData() when the method is called without arguments,algorkov@…,snover,"jQuery 1.4.4
IE8, FF3.6, Chrome 8
Windows 7 

According to the documentation and comments in jQuery code for removeData() method ""...when called with no arguments, all values are removed"".

But it is obvious from code of the data.js module that if browser either suppors deleting expandos or DOM element has removeAttribute method then only this expando attribute will be removed but jQuery.cache item for the respective element data states in place. That is the link to the data is broken but the data itself is kept. I do not see any obvious reason for such behavior unless someone explains me the reasoning. 
Why keep the data in memory when it was explicitly removed and can't be accessed?
Ok, the code in jQuery data.js module is:

{{{
// Otherwise, we want to remove all of the element's data
} else {
	if ( isNode && jQuery.support.deleteExpando ) {
		delete elem[ jQuery.expando ];

	} else if ( elem.removeAttribute ) {
		elem.removeAttribute( jQuery.expando );

	// Completely remove the data cache
	} else if ( isNode ) {
		delete cache[ id ];

	// Remove all fields from the object
	} else {
		for ( var n in elem ) {
			delete elem[ n ];
		}
	}
}
}}}

Hope my point is clear. And here is the link to jsFiddle script 
to reproduce the behavior: [http://jsfiddle.net/algor/6vjtM/1/]
Please enable Firebug/Chrome/IE console because the script logs to it.

Also, maybe I am wrong but the aforementioned piece of code in data.js looks poorly written to me. For example, why there is no check for isNode when elem.removeAttribute existence is verified. And why the case for object properties deletion is in another ""else"" while it is most probably intended for plain objects and hence it would be better to logically separate it from this incomprehensible sequence of ""else's"". 

On a separate note. Could someone name a person/place where/to whom it is appropriate to ask questions regarding jQuery data module implementation and jQuery core in general? I mean it would be great to know that the person who answers actually possesses sacred knowledge and not just speculates and makes assumptions regarding reasons why something is implemented the way it is.
Thanks

",bug,closed,blocker,1.5,data,1.4.4,fixed,memory leak,,,6968
