aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjeresig <jeresig@gmail.com>2010-02-13 01:45:09 -0500
committerjeresig <jeresig@gmail.com>2010-02-13 01:45:09 -0500
commit7a467ed9360c2c55ea55a56e5767c9581e4f4f69 (patch)
tree407edab158e46b746000c219a53e04a290fc3c7e /src
parent8404ad6070d1fae8e667eed734d958154f0d7e3c (diff)
downloadjquery-7a467ed9360c2c55ea55a56e5767c9581e4f4f69.tar.gz
jquery-7a467ed9360c2c55ea55a56e5767c9581e4f4f69.zip
Remove the need for the internal setArray method, it was only really used by pushStack anyway. Fixes #6003.
Diffstat (limited to 'src')
-rw-r--r--src/core.js21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/core.js b/src/core.js
index 34bab952d..02d8269d2 100644
--- a/src/core.js
+++ b/src/core.js
@@ -197,7 +197,14 @@ jQuery.fn = jQuery.prototype = {
// (returning the new matched element set)
pushStack: function( elems, name, selector ) {
// Build a new jQuery matched element set
- var ret = jQuery( elems || null );
+ var ret = jQuery();
+
+ if ( jQuery.isArray( elems ) ) {
+ push.apply( ret, elems );
+
+ } else {
+ jQuery.merge( ret, elems );
+ }
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
@@ -214,18 +221,6 @@ jQuery.fn = jQuery.prototype = {
return ret;
},
- // Force the current matched set of elements to become
- // the specified array of elements (destroying the stack in the process)
- // You should use pushStack() in order to do this, but maintain the stack
- setArray: function( elems ) {
- // Resetting the length to 0, then using the native Array push
- // is a super-fast way to populate an object with array-like properties
- this.length = 0;
- push.apply( this, elems );
-
- return this;
- },
-
// Execute a callback for every element in the matched set.
// (You can seed the arguments with an array of args, but this is
// only used internally.)