aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-10-23 20:22:34 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-10-24 22:36:20 -0400
commit69e2f068fe7d16c1ccd6cb99c6376f0d8891ea33 (patch)
tree47d0bdb62782c6650f9d99fd6cd3c6335aa9f47d
parent305e169ad663849cd8b4935e8f70c55dc8e2be01 (diff)
downloadjquery-69e2f068fe7d16c1ccd6cb99c6376f0d8891ea33.tar.gz
jquery-69e2f068fe7d16c1ccd6cb99c6376f0d8891ea33.zip
Fix #9469. Remove semi-functional .selector property. Close gh-1006.
Saved 65 bytes.
-rw-r--r--src/core.js9
-rw-r--r--src/manipulation.js2
-rw-r--r--src/traversing.js12
3 files changed, 9 insertions, 14 deletions
diff --git a/src/core.js b/src/core.js
index fa9899682..ae514e855 100644
--- a/src/core.js
+++ b/src/core.js
@@ -203,22 +203,15 @@ jQuery.fn = jQuery.prototype = {
// Take an array of elements and push it onto the stack
// (returning the new matched element set)
- pushStack: function( elems, name, selector ) {
+ pushStack: function( elems ) {
// Build a new jQuery matched element set
var ret = jQuery.merge( this.constructor(), elems );
// Add the old object onto the stack (as a reference)
ret.prevObject = this;
-
ret.context = this.context;
- if ( name === "find" ) {
- ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
- } else if ( name ) {
- ret.selector = this.selector + "." + name + "(" + selector + ")";
- }
-
// Return the newly-formed element set
return ret;
},
diff --git a/src/manipulation.js b/src/manipulation.js
index 43bb9a0a0..f0f65ecff 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -564,7 +564,7 @@ jQuery.each({
ret = ret.concat( elems );
}
- return this.pushStack( ret, name, insert.selector );
+ return this.pushStack( ret );
}
};
});
diff --git a/src/traversing.js b/src/traversing.js
index 3e04bf4fb..1f38d68cd 100644
--- a/src/traversing.js
+++ b/src/traversing.js
@@ -25,7 +25,7 @@ jQuery.fn.extend({
});
}
- ret = this.pushStack( "", "find", selector );
+ ret = this.pushStack( [] );
for ( i = 0, l = this.length; i < l; i++ ) {
length = ret.length;
@@ -44,6 +44,8 @@ jQuery.fn.extend({
}
}
+ // Needed because $( "selector", context ) becomes $( context ).find( "selector" )
+ ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
return ret;
},
@@ -62,11 +64,11 @@ jQuery.fn.extend({
},
not: function( selector ) {
- return this.pushStack( winnow(this, selector, false), "not", selector);
+ return this.pushStack( winnow(this, selector, false) );
},
filter: function( selector ) {
- return this.pushStack( winnow(this, selector, true), "filter", selector );
+ return this.pushStack( winnow(this, selector, true) );
},
is: function( selector ) {
@@ -103,7 +105,7 @@ jQuery.fn.extend({
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
- return this.pushStack( ret, "closest", selectors );
+ return this.pushStack( ret );
},
// Determine the position of an element within
@@ -216,7 +218,7 @@ jQuery.each({
ret = ret.reverse();
}
- return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
+ return this.pushStack( ret );
};
});