Skip to content
Permalink
Browse files
Fixed a bug with how pushStack was checking for arrays.
  • Loading branch information
jeresig committed Jul 6, 2006
1 parent 586e368 commit 214007721c67d9702571e45573cf32c61c2201a8
Showing with 3 additions and 3 deletions.
  1. +3 −3 jquery/jquery.js
@@ -51,7 +51,7 @@ function jQuery(a,c) {
return new jQuery(a,c);

// Watch for when an array is passed in
this.pushStack( a.constructor == Array ?
this.get( a.constructor == Array ?
// Assume that it's an array of DOM Elements
a :

@@ -275,9 +275,9 @@ jQuery.fn = jQuery.prototype = {
},

pushStack: function(a,args) {
var fn = args ? (args.constructor == Function ? args : args[args.length-1]) : function(){};
var fn = args[args.length-1];

if ( !fn ) {
if ( !fn || fn.constructor != Function ) {
if ( !this.stack ) this.stack = [];
this.stack.push( this.get() );
this.get( a );

0 comments on commit 2140077

Please sign in to comment.