jquery core: simplified the code using the new jQuery.makeArray from [5314] where...
authorAriel Flesler <aflesler@gmail.com>
Thu, 24 Apr 2008 21:46:22 +0000 (21:46 +0000)
committerAriel Flesler <aflesler@gmail.com>
Thu, 24 Apr 2008 21:46:22 +0000 (21:46 +0000)
src/core.js
src/event.js
src/fx.js

index 072642f..66efc18 100644 (file)
@@ -86,17 +86,8 @@ jQuery.fn = jQuery.prototype = {
                // Shortcut for document ready
                } else if ( jQuery.isFunction( selector ) )
                        return new jQuery( document )[ jQuery.fn.ready ? "ready" : "load" ]( selector );
-
-               return this.setArray(
-                       // HANDLE: $(array)
-                       selector.constructor == Array && selector ||
-
-                       // HANDLE: $(arraylike)
-                       // Watch for when an array-like object, contains DOM nodes, is passed in as the selector
-                       (selector.jquery || selector.length && selector != window && !selector.nodeType && selector[0] != undefined && selector[0].nodeType) && jQuery.makeArray( selector ) ||
-
-                       // HANDLE: $(*)
-                       [ selector ] );
+               
+               return this.setArray(jQuery.makeArray(selector));
        },
        
        // The current version of jQuery being used
index 25161d3..5b77e8c 100644 (file)
@@ -160,7 +160,7 @@ jQuery.event = {
 
        trigger: function(type, data, elem, donative, extra) {
                // Clone the incoming data, if any
-               data = jQuery.makeArray(data || []);
+               data = jQuery.makeArray(data);
 
                if ( type.indexOf("!") >= 0 ) {
                        type = type.slice(0, -1);
index 64cfbc6..824616a 100644 (file)
--- a/src/fx.js
+++ b/src/fx.js
@@ -188,8 +188,7 @@ var queue = function( elem, type, array ) {
        var q = jQuery.data( elem, type + "queue" );
 
        if ( !q || array )
-               q = jQuery.data( elem, type + "queue", 
-                       array ? jQuery.makeArray(array) : [] );
+               q = jQuery.data( elem, type + "queue", jQuery.makeArray(array) );
 
        return q;
 };