X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=d78ec7e4121c2a1efee7231bd1db1ee64985cfbc;hb=20827707a94c8569bcc422f71bf5b37bc55695df;hp=b3142d0c67af426ee90b9782fc6a3501a57015f1;hpb=d75c899fe78c52d89e5fb757ded979aca126d37b;p=jquery.git diff --git a/src/core.js b/src/core.js index b3142d0..d78ec7e 100644 --- a/src/core.js +++ b/src/core.js @@ -75,7 +75,9 @@ jQuery.fn = jQuery.prototype = { this.context = selector.context; } - return this.setArray(jQuery.makeArray(selector)); + return this.setArray(jQuery.isArray( selector ) ? + selector : + jQuery.makeArray(selector)); }, // Start with an empty selector @@ -95,7 +97,7 @@ jQuery.fn = jQuery.prototype = { return num === undefined ? // Return a 'clean' array - jQuery.makeArray( this ) : + Array.prototype.slice.call( this ) : // Return just the object this[ num ]; @@ -265,8 +267,10 @@ jQuery.fn = jQuery.prototype = { }, // For internal use only. - // Behaves like an Array's .push method, not like a jQuery method. + // Behaves like an Array's method, not like a jQuery method. push: [].push, + sort: [].sort, + splice: [].splice, find: function( selector ) { if ( this.length === 1 ) {