diff options
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/unit/data.js b/test/unit/data.js index d6f979984..72e55e15e 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -670,3 +670,14 @@ test( "JSON data- attributes can have newlines", function() { equal( x.data("some").foo, "bar", "got a JSON data- attribute with spaces" ); x.remove(); }); + +test(".data doesn't throw when calling selection is empty. #13551", function() { + expect(1); + + try { + jQuery( null ).data( "prop" ); + ok( true, "jQuery(null).data('prop') does not throw" ); + } catch ( e ) { + ok( false, e.message ); + } +}); |