Removed the need for the results set to have array methods. Resolves jQuery bug #4250.
This commit is contained in:
parent
f094c803de
commit
58235cc38e
2 changed files with 13 additions and 15 deletions
11
src/core.js
11
src/core.js
|
@ -279,14 +279,9 @@ jQuery.fn = jQuery.prototype = {
|
|||
return this.prevObject || jQuery(null);
|
||||
},
|
||||
|
||||
// For internal use only.
|
||||
// Behaves like an Array's method, not like a jQuery method.
|
||||
push: [].push,
|
||||
sort: [].sort,
|
||||
splice: [].splice,
|
||||
|
||||
find: function( selector ) {
|
||||
var ret = this.pushStack( "", "find", selector ), length = 0;
|
||||
var ret = this.pushStack( "", "find", selector ), length = 0,
|
||||
splice = Array.prototype.splice;
|
||||
|
||||
for ( var i = 0, l = this.length; i < l; i++ ) {
|
||||
length = ret.length;
|
||||
|
@ -297,7 +292,7 @@ jQuery.fn = jQuery.prototype = {
|
|||
for ( var n = length; n < ret.length; n++ ) {
|
||||
for ( var r = 0; r < length; r++ ) {
|
||||
if ( ret[r] === ret[n] ) {
|
||||
ret.splice(n--, 1);
|
||||
splice.call(ret, n--, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue