From: Colin Snover Date: Mon, 17 Jan 2011 21:22:49 +0000 (-0600) Subject: Introduce a temporary hack to allow jQuery.fn.data("events") to continue to work... X-Git-Tag: 1.5rc1~51^2~1^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57cc182a40e909868d41f9b1bb405b06138f6cae;p=jquery.git Introduce a temporary hack to allow jQuery.fn.data("events") to continue to work. This will be going away in 1.6. More information will be available in the 1.5 release notes. --- diff --git a/src/data.js b/src/data.js index a1abc9ed6..21f0e3a55 100644 --- a/src/data.js +++ b/src/data.js @@ -93,6 +93,13 @@ jQuery.extend({ thisCache[ name ] = data; } + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should + // not attempt to inspect the internal events object using jQuery.data, as this + // internal data object is undocumented and subject to change. + if ( name === "events" && !thisCache[name] ) { + return thisCache[ internalKey ] && thisCache[ internalKey ].events; + } + return getByName ? thisCache[ name ] : thisCache; },