Fix/test for #861
[jquery.git] / src / jquery / jquery.js
index 19ee7c1..b720954 100644 (file)
@@ -257,9 +257,10 @@ jQuery.fn = jQuery.prototype = {
         * @cat Core
         */
        pushStack: function( a ) {
-               var ret = jQuery(this);
+               var ret = jQuery(a);
                ret.prevObject = this;
-               return ret.setArray( a );
+               //return ret.setArray( a );
+               return ret;
        },
        
        /**
@@ -803,7 +804,7 @@ jQuery.fn = jQuery.prototype = {
        find: function(t) {
                return this.pushStack( jQuery.map( this, function(a){
                        return jQuery.find(t,a);
-               }) );
+               }), t );
        },
 
        /**
@@ -931,7 +932,7 @@ jQuery.fn = jQuery.prototype = {
 
                        jQuery.grep(this, function(a) {
                                return ( t.constructor == Array || t.jquery )
-                                       ? console.log("t: %o a: %o", t, a) | jQuery.inArray( a, t ) < 0
+                                       ? jQuery.inArray( a, t ) < 0
                                        : a != t;
                        })
                );
@@ -986,7 +987,7 @@ jQuery.fn = jQuery.prototype = {
                        this.get(),
                        t.constructor == String ?
                                jQuery(t).get() :
-                               t.length != undefined && !t.nodeName ?
+                               t.length != undefined && (!t.nodeName || t.nodeName == "FORM") ?
                                        t : [t] )
                );
        },