Skip to content
Permalink
Browse files

Fix for issues discussed in 9faab0b. Goes towards fixing #6808.

  • Loading branch information...
Dave Reed authored and jeresig committed Jul 23, 2010
1 parent 266facc commit 2084e01780b57e5becbb00817b883175ef67b0b5
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/data.js
@@ -27,7 +27,8 @@ jQuery.extend({
elem;

var id = elem[ jQuery.expando ], cache = jQuery.cache, thisCache,
isNode = elem.nodeType;
isNode = elem.nodeType,
store;

if ( !id && typeof name === "string" && data === undefined ) {
return;
@@ -49,24 +50,25 @@ jQuery.extend({
if ( isNode ) {
cache[ id ] = jQuery.extend(true, {}, name);
} else {
store = jQuery.extend(true, {}, name);
cache[ id ] = function() {
return jQuery.extend(true, {}, name);
return store;
};
}

} else if ( !cache[ id ] ) {
if ( isNode ) {
cache[ id ] = {};
} else {
var store = {};
store = {};
cache[ id ] = function() {
return store;
};
}

}

thisCache = isNode? cache[ id ] : cache[ id ]();
thisCache = isNode ? cache[ id ] : cache[ id ]();

// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {

0 comments on commit 2084e01

Please sign in to comment.
You can’t perform that action at this time.