diff options
author | Richard Gibson <richard.gibson@gmail.com> | 2011-12-06 15:25:38 -0500 |
---|---|---|
committer | Dave Methvin <dave.methvin@gmail.com> | 2011-12-06 15:25:38 -0500 |
commit | 6c2a501de40a5f6b3ad382e2d309e5a10fce04d0 (patch) | |
tree | c72333c9a1d5d29acd4e3224ddf6d4e4e00db5fe /test/unit/data.js | |
parent | d511613d748a92af04a3f07943f34f9baadc4153 (diff) | |
download | jquery-6c2a501de40a5f6b3ad382e2d309e5a10fce04d0.tar.gz jquery-6c2a501de40a5f6b3ad382e2d309e5a10fce04d0.zip |
Fix #5571. Setters should treat `undefined` as a no-op and be chainable.
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index 133793817..006e29e6a 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -222,8 +222,7 @@ test(".data(String) and .data(String, Object)", function() { div.data("test", "overwritten"); equal( div.data("test"), "overwritten", "Check for overwritten data" ); - div.data("test", undefined); - equal( div.data("test"), "overwritten", "Check that data wasn't removed"); + equal( div.data("test", undefined).data("test"), "overwritten", "Check that .data('key',undefined) does nothing but is chainable (#5571)"); div.data("test", null); ok( div.data("test") === null, "Check for null data"); |