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 19:57:34 +0200 |
commit | bf48c21d225c31f0f9b5441d95f73615ca3dcfdb (patch) | |
tree | cd02658ecd5a3419f388aae4ea984f5dc85caa8c /test | |
parent | d24275372624bac897c4131fd1507a58c09a1483 (diff) | |
download | jquery-bf48c21d225c31f0f9b5441d95f73615ca3dcfdb.tar.gz jquery-bf48c21d225c31f0f9b5441d95f73615ca3dcfdb.zip |
Core: .each/.map should accept an undefined/null value
Fixes gh-2267
Closes gh-2363
Diffstat (limited to 'test')
-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 8cfe98f83..1ddf695a6 100644 --- a/test/unit/core.js +++ b/test/unit/core.js @@ -1198,6 +1198,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 ); |