aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2013-04-01 17:09:37 -0400
committerRick Waldron <waldron.rick@gmail.com>2013-04-01 17:09:37 -0400
commit73b315538f21cab1118e72402576f3851c555b95 (patch)
treef509d4045b1390baecc8684a9b88a7a71df11326
parent5b59a63b2b9247b326c654ca941a1dfe77914024 (diff)
downloadjquery-73b315538f21cab1118e72402576f3851c555b95.tar.gz
jquery-73b315538f21cab1118e72402576f3851c555b95.zip
Better approach the hasData side effects fix. Thanks gibson042
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
-rw-r--r--src/data.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/data.js b/src/data.js
index 189de6259..eedde4d6f 100644
--- a/src/data.js
+++ b/src/data.js
@@ -21,17 +21,11 @@ function Data() {
Data.uid = 1;
Data.prototype = {
- key: function( owner, options ) {
+ key: function( owner ) {
var descriptor = {},
// Check if the owner object already has a cache key
unlock = owner[ this.expando ];
- // `readonly` calls from hasData, on owners with no key
- // should not create new/empty cache records
- if ( !unlock && (options && options.readonly) ) {
- return null;
- }
-
// If not, create one
if ( !unlock ) {
unlock = Data.uid++;
@@ -164,7 +158,7 @@ Data.prototype = {
},
hasData: function( owner ) {
return !jQuery.isEmptyObject(
- this.cache[ this.key( owner, { readonly: true }) ] || {}
+ this.cache[ owner[ this.expando ] ] || {}
);
},
discard: function( owner ) {