aboutsummaryrefslogtreecommitdiffstats
path: root/src/data.js
diff options
context:
space:
mode:
authorColin Snover <github.com@zetafleet.com>2010-12-22 14:54:37 -0600
committerColin Snover <github.com@zetafleet.com>2010-12-22 14:54:37 -0600
commitf5d4bf8920868c2d1f88cc4f3bfcf85c0b566b2e (patch)
tree676c53f59e13de5f1f9f431e1edd5b9c7be257a2 /src/data.js
parent445fdf720ce26b99aadace85b7ec976f90583c3a (diff)
downloadjquery-f5d4bf8920868c2d1f88cc4f3bfcf85c0b566b2e.tar.gz
jquery-f5d4bf8920868c2d1f88cc4f3bfcf85c0b566b2e.zip
Update jQuery.hasData to always return a boolean, with unit tests.
Diffstat (limited to 'src/data.js')
-rw-r--r--src/data.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/data.js b/src/data.js
index 120fe718d..c3530c835 100644
--- a/src/data.js
+++ b/src/data.js
@@ -22,7 +22,7 @@ jQuery.extend({
},
hasData: function( elem ) {
- return !elem.nodeType || (elem[ jQuery.expando ] && !jQuery.isEmptyObject(jQuery.cache[ elem[jQuery.expando] ]));
+ return !elem.nodeType || (!!elem[ jQuery.expando ] && !jQuery.isEmptyObject(jQuery.cache[ elem[jQuery.expando] ]));
},
data: function( elem, name, data ) {