diff options
author | Thomas Tortorini <thomastortorini@gmail.com> | 2015-06-25 06:18:04 +0200 |
---|---|---|
committer | Michał Gołębiowski <m.goleb@gmail.com> | 2015-07-27 20:02:54 +0200 |
commit | 15f48047bcf01389643e1561de9907c417529e83 (patch) | |
tree | abfcf365fcb45cf3414dae343095b1c7e06aa886 /test/unit | |
parent | 9c373c31410deb8e4a11aa7ce226d5e9169c7852 (diff) | |
download | jquery-15f48047bcf01389643e1561de9907c417529e83.tar.gz jquery-15f48047bcf01389643e1561de9907c417529e83.zip |
Core: .each/.map should accept an undefined/null value
(cherry-picked from bf48c21d225c31f0f9b5441d95f73615ca3dcfdb)
Fixes gh-2267
Closes gh-2363
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/core.js | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/core.js b/test/unit/core.js index 848ca2a5f..1c52bde3b 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1182,6 +1182,18 @@ test("jQuery.each(Object,Function)", function() { equal( i, document.styleSheets.length, "Iteration over document.styleSheets" ); }); +test("jQuery.each/map(undefined/null,Function)", 1, function() { + try { + jQuery.each( undefined, jQuery.noop ); + jQuery.each( null, jQuery.noop ); + jQuery.map( undefined, jQuery.noop ); + jQuery.map( null, jQuery.noop ); + ok( true, "jQuery.each/map( undefined/null, function() {} );" ); + } catch ( e ) { + ok( false, "each/map must accept null and undefined values" ); + } +}); + test( "JIT compilation does not interfere with length retrieval (gh-2145)", function() { expect( 4 ); |