git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix for issues discussed in 9faab0b74fd316c2161612236d9ea8a01f3c78f8. Goes towards...
[jquery.git]
/
src
/
data.js
diff --git
a/src/data.js
b/src/data.js
index
6dcfb4c
..
eb96b86
100644
(file)
--- a/
src/data.js
+++ b/
src/data.js
@@
-27,7
+27,8
@@
jQuery.extend({
elem;
var id = elem[ jQuery.expando ], cache = jQuery.cache, thisCache,
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;
if ( !id && typeof name === "string" && data === undefined ) {
return;
@@
-49,27
+50,25
@@
jQuery.extend({
if ( isNode ) {
cache[ id ] = jQuery.extend(true, {}, name);
} else {
if ( isNode ) {
cache[ id ] = jQuery.extend(true, {}, name);
} else {
+ store = jQuery.extend(true, {}, name);
cache[ id ] = function() {
cache[ id ] = function() {
- return jQuery.extend(true, {}, name);
- }
+ return store;
+ };
}
} else if ( !cache[ id ] ) {
if ( isNode ) {
cache[ id ] = {};
} else {
}
} else if ( !cache[ id ] ) {
if ( isNode ) {
cache[ id ] = {};
} else {
- var store = {};
+ store = {};
cache[ id ] = function() {
return store;
cache[ id ] = function() {
return store;
- }
+ };
}
}
}
}
- thisCache = cache[ id ];
- if ( !isNode ) {
- thisCache = thisCache();
- }
+ thisCache = isNode ? cache[ id ] : cache[ id ]();
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {
// Prevent overriding the named cache with undefined values
if ( data !== undefined ) {