aboutsummaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorThomas Tortorini <thomastortorini@gmail.com>2015-06-25 06:18:04 +0200
committerMichał Gołębiowski <m.goleb@gmail.com>2015-07-27 20:02:54 +0200
commit15f48047bcf01389643e1561de9907c417529e83 (patch)
treeabfcf365fcb45cf3414dae343095b1c7e06aa886 /test/unit
parent9c373c31410deb8e4a11aa7ce226d5e9169c7852 (diff)
downloadjquery-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.js12
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 );