mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Core: .each/.map should accept an undefined/null value
(cherry-picked from bf48c21d22)
Fixes gh-2267
Closes gh-2363
This commit is contained in:
committed by
Michał Gołębiowski
parent
9c373c3141
commit
15f48047bc
@@ -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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user