diff options
author | Rick Waldron <waldron.rick@gmail.com> | 2013-04-01 12:48:30 -0400 |
---|---|---|
committer | Rick Waldron <waldron.rick@gmail.com> | 2013-04-01 12:48:30 -0400 |
commit | 332a490573bbbd9e7df1381bde8f590240cb8679 (patch) | |
tree | a5b0e46fb4a25f41a146bb9e50ce0f4240588904 /test | |
parent | 1f530e286755416369f4452d20f5ab6bb175451d (diff) | |
download | jquery-332a490573bbbd9e7df1381bde8f590240cb8679.tar.gz jquery-332a490573bbbd9e7df1381bde8f590240cb8679.zip |
Avoid side-effects when calling jQuery.hasData
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
Diffstat (limited to 'test')
-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 d813ec82d..2f9c25ed5 100644 --- a/test/unit/data.js +++ b/test/unit/data.js @@ -51,6 +51,17 @@ test( "jQuery._data & _removeData, expected returns", function() { ); }); +test( "jQuery.hasData no side effects", function() { + expect(1); + var obj = {}; + + jQuery.hasData( obj ); + + equal( Object.getOwnPropertyNames( obj ).length, 0, + "No data expandos where added when calling jQuery.hasData(o)" + ); +}); + function dataTests (elem) { var oldCacheLength, dataObj, internalDataObj, expected, actual; |