]> source.dussan.org Git - jquery.git/commitdiff
jquery core: makeArray was parsing forms into array of elements.
authorAriel Flesler <aflesler@gmail.com>
Tue, 6 May 2008 23:28:21 +0000 (23:28 +0000)
committerAriel Flesler <aflesler@gmail.com>
Tue, 6 May 2008 23:28:21 +0000 (23:28 +0000)
src/core.js

index fbf9f99562db70162e7aa9db0b14e14c35cc06b8..9752fb16292f7fcf6f14b2aa951f76f9e529de03 100644 (file)
@@ -1109,14 +1109,14 @@ jQuery.extend({
        makeArray: function( array ) {
                var ret = [];
 
-               if( array != undefined ){
+               if( array != null ){
                        var i = array.length;
-                       //the window, strings and functions also have 'length'
-                       if( i != null && !array.split && array != window && !array.call )
+                       //the window, forms, strings and functions also have 'length'
+                       if( i == null || array.split || array.setInterval || array.call || array.elements )
+                               ret[0] = array;
+                       else
                                while( i )
                                        ret[--i] = array[i];
-                       else
-                               ret[0] = array;
                }
 
                return ret;