aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit/data.js
diff options
context:
space:
mode:
authorCorey Frang <gnarf37@gmail.com>2013-11-05 15:03:28 -0500
committerRick Waldron <waldron.rick@gmail.com>2013-11-06 10:25:12 -0500
commit30eee925dbc9f8d465ccf064f48c24061ffdc378 (patch)
tree53797510073b85d5fe48f71dc97cf8443de8f1f1 /test/unit/data.js
parentcc19a6bd3b6183887b52a965e77234f4dd9684ca (diff)
downloadjquery-30eee925dbc9f8d465ccf064f48c24061ffdc378.tar.gz
jquery-30eee925dbc9f8d465ccf064f48c24061ffdc378.zip
Fix #14101: $().data() should be undefined, not null
Diffstat (limited to 'test/unit/data.js')
-rw-r--r--test/unit/data.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index bf5629644..086067cdc 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -170,6 +170,12 @@ test("jQuery.data(object/flash)", 25, function() {
dataTests( flash );
});
+// attempting to access the data of an undefined jQuery element should be undefined
+test("jQuery().data() === undefined (#14101)", 2, function() {
+ strictEqual(jQuery().data(), undefined);
+ strictEqual(jQuery().data("key"), undefined);
+});
+
test(".data()", function() {
expect(5);