jQuery: The Write Less, Do More JavaScript Library

Ticket #2510: core-merge.patch

File core-merge.patch, 0.9 kB (added by diego, 5 months ago)
  • core.js

    old new  
    11441144 
    11451145        // Also, we need to make sure that the correct elements are being returned 
    11461146        // (IE returns comment nodes in a '*' query) 
    1147         if ( jQuery.browser.msie ) { 
    1148             for ( var i = 0; second[ i ]; i++ ) 
    1149                 if ( second[ i ].nodeType != 8 ) 
    1150                     first.push( second[ i ] ); 
    1151  
    1152         } else 
    1153             for ( var i = 0; second[ i ]; i++ ) 
    1154                 first.push( second[ i ] ); 
    1155  
    1156         return first; 
     1147        jQuery.merge = jQuery.browser.msie ? 
     1148            function( first, second ) { 
     1149                var a, i = -1; 
     1150                while (a = second[++i]) 
     1151                    if ( a.nodeType != 8 ) 
     1152                        first[first.length] = a; 
     1153                return first; 
     1154            } : 
     1155            function( first, second ) { 
     1156                var a, i = -1; 
     1157                while (a = second[++i]) 
     1158                    first[first.length] = a; 
     1159                return first; 
     1160            }; 
     1161        return jQuery.merge( first, second ); 
    11571162    }, 
    11581163 
    11591164    unique: function( array ) {