Fixed a bug with $.map() and undefined values.

This commit is contained in:
John Resig 2006-07-04 04:37:09 +00:00
parent 0027439156
commit 4531ab1324

2
jquery/jquery.js vendored
View File

@ -751,7 +751,7 @@ jQuery.map = function(a,f) {
var r = []; var r = [];
for ( var i = 0; i < a.length; i++ ) { for ( var i = 0; i < a.length; i++ ) {
var t = f(a[i],i); var t = f(a[i],i);
if ( t !== null ) { if ( t !== null && t != undefined ) {
if ( t.constructor != Array ) t = [t]; if ( t.constructor != Array ) t = [t];
r = jQuery.merge( t, r ); r = jQuery.merge( t, r );
} }