Bug Tracker

Changeset 5314

Show
Ignore:
Timestamp:
04/24/08 21:23:36 (7 months ago)
Author:
joern.zaefferer
Message:

jquery core: Patch from #2619 applied, making makeArray more flexible and faster; removed hint to ticket from (previously failing) test

Location:
trunk/jquery
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/jquery/src/core.js

    r5274 r5314  
    11241124        var ret = []; 
    11251125 
    1126         // Need to use typeof to fight Safari childNodes crashes 
    1127         if ( array.constructor != Array ) 
    1128             for ( var i = 0, length = array.length; i < length; i++ ) 
    1129                 ret.push( array[ i ] ); 
    1130         else 
    1131             ret = array.slice( 0 ); 
     1126        if( array != undefined ) 
     1127            //strings and functions also have 'length' 
     1128            if( array.length != undefined && !array.split && !array.call ) 
     1129                for( var i = array.length; i; ) 
     1130                    ret[--i] = array[i]; 
     1131            else 
     1132                ret[0] = array; 
    11321133 
    11331134        return ret; 
  • trunk/jquery/test/unit/core.js

    r5284 r5314  
    15631563}); 
    15641564 
    1565 test("makeArray(#2619)", function(){ 
     1565test("$.makeArray", function(){ 
    15661566    expect(11); 
    15671567