jQuery.find = Sizzle;
jQuery.expr = Sizzle.selectors;
jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
+jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort;
jQuery.text = Sizzle.getText;
jQuery.isXMLDoc = Sizzle.isXML;
jQuery.contains = Sizzle.contains;
}
}
- return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched );
},
// Determine the position of an element within the set
add: function( selector, context ) {
return this.pushStack(
- jQuery.unique(
+ jQuery.uniqueSort(
jQuery.merge( this.get(), jQuery( selector, context ) )
)
);
if ( this.length > 1 ) {
// Remove duplicates
if ( !guaranteedUnique[ name ] ) {
- jQuery.unique( matched );
+ jQuery.uniqueSort( matched );
}
// Reverse order for parents* and prev-derivatives
jQuery.find( selector, self[ i ], ret );
}
- return this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ return this.pushStack( len > 1 ? jQuery.uniqueSort( ret ) : ret );
},
filter: function( selector ) {
return this.pushStack( winnow(this, selector || [], false) );
ok( !jQuery.contains(document, detached), "document container (negative)" );
});
-test("jQuery.unique", function() {
+test("jQuery.uniqueSort", function() {
expect( 14 );
function Arrayish( arr ) {
jQuery.each( tests, function( label, test ) {
var length = test.length || test.input.length;
- deepEqual( jQuery.unique( test.input ).slice( 0, length ), test.expected, label + " (array)" );
- deepEqual( jQuery.unique( new Arrayish(test.input) ).slice( 0, length ), test.expected, label + " (quasi-array)" );
+ deepEqual( jQuery.uniqueSort( test.input ).slice( 0, length ), test.expected, label + " (array)" );
+ deepEqual( jQuery.uniqueSort( new Arrayish(test.input) ).slice( 0, length ), test.expected, label + " (quasi-array)" );
});
});
jQuery.each( methodDirections, function( method, reversed ) {
var actual = elems[ method ]().get(),
- forward = jQuery.unique( [].concat( actual ) );
+ forward = jQuery.uniqueSort( [].concat( actual ) );
deepEqual( actual, reversed ? forward.reverse() : forward, "Correct sort direction for " + method );
});
});