Fix #10589. Remove deprecated $.fn.data("events") special case.

No unit tests were harmed in the removal of this hack.
This commit is contained in:
Dave Methvin 2012-06-11 17:16:19 -04:00
parent 6af0bcc626
commit 9e0c056171

View File

@ -32,7 +32,7 @@ jQuery.extend({
return;
}
var privateCache, thisCache, ret,
var thisCache, ret,
internalKey = jQuery.expando,
getByName = typeof name === "string",
@ -46,12 +46,11 @@ jQuery.extend({
// Only defining an ID for JS objects if its cache already exists allows
// the code to shortcut on the same path as a DOM node with no cache
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
isEvents = name === "events";
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
// Avoid doing any more work than we need to when trying to get data on an
// object that has no data at all
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
return;
}
@ -85,7 +84,7 @@ jQuery.extend({
}
}
privateCache = thisCache = cache[ id ];
thisCache = cache[ id ];
// jQuery data() is stored in a separate object inside the object's internal data
// cache in order to avoid key collisions between internal data and user-defined
@ -102,12 +101,6 @@ jQuery.extend({
thisCache[ jQuery.camelCase( name ) ] = data;
}
// Users should not attempt to inspect the internal events object using jQuery.data,
// it is undocumented and subject to change. But does anyone listen? No.
if ( isEvents && !thisCache[ name ] ) {
return privateCache.events;
}
// Check for both converted-to-camel and non-converted data property names
// If a data property was specified
if ( getByName ) {