Bug Tracker

Changeset 5317

Show
Ignore:
Timestamp:
04/24/08 21:46:22 (7 months ago)
Author:
aflesler
Message:

jquery core: simplified the code using the new jQuery.makeArray from [5314] where possible.

Location:
trunk/jquery/src
Files:
3 modified

Legend:

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

    r5314 r5317  
    8787        } else if ( jQuery.isFunction( selector ) ) 
    8888            return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector ); 
    89  
    90         return this.setArray( 
    91             // HANDLE: $(array) 
    92             selector.constructor == Array && selector || 
    93  
    94             // HANDLE: $(arraylike) 
    95             // Watch for when an array-like object, contains DOM nodes, is passed in as the selector 
    96             (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) || 
    97  
    98             // HANDLE: $(*) 
    99             [ selector ] ); 
     89         
     90        return this.setArray(jQuery.makeArray(selector)); 
    10091    }, 
    10192     
  • trunk/jquery/src/event.js

    r5290 r5317  
    161161    trigger: function(type, data, elem, donative, extra) { 
    162162        // Clone the incoming data, if any 
    163         data = jQuery.makeArray(data || []); 
     163        data = jQuery.makeArray(data); 
    164164 
    165165        if ( type.indexOf("!") >= 0 ) { 
  • trunk/jquery/src/fx.js

    r4429 r5317  
    189189 
    190190    if ( !q || array ) 
    191         q = jQuery.data( elem, type + "queue",  
    192             array ? jQuery.makeArray(array) : [] ); 
     191        q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) ); 
    193192 
    194193    return q;