Ticket 6808. Updated per code review comments by jeresig
authorInfinitiesLoop <dareed@microsoft.com>
Thu, 22 Jul 2010 17:48:24 +0000 (01:48 +0800)
committerJohn Resig <jeresig@gmail.com>
Thu, 22 Jul 2010 19:52:02 +0000 (03:52 +0800)
src/data.js

index 6dcfb4c..c524a45 100644 (file)
@@ -51,7 +51,7 @@ jQuery.extend({
                        } else {
                                cache[ id ] = function() {
                                        return jQuery.extend(true, {}, name);
-                               }
+                               };
                        }
 
                } else if ( !cache[ id ] ) {
@@ -61,15 +61,12 @@ jQuery.extend({
                                var 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 ) {