end: function() {
return this.prevObject || this.constructor();
- },
-
- // For internal use only.
- // Behaves like an Array's method, not like a jQuery method.
- push: push,
- sort: arr.sort,
- splice: arr.splice
+ }
};
jQuery.extend = jQuery.fn.extend = function() {
// Document context
if ( nodeType === 9 ) {
if ( ( elem = context.getElementById( m ) ) ) {
- results.push( elem );
+ push.call( results, elem );
}
return results;
if ( newContext && ( elem = newContext.getElementById( m ) ) &&
jQuery.contains( context, elem ) ) {
- results.push( elem );
+ push.call( results, elem );
return results;
}
}
}
while ( ( matcher = elementMatchers[ j++ ] ) ) {
if ( matcher( elem, context || document, xml ) ) {
- results.push( elem );
+ push.call( results, elem );
break;
}
}
define( [
"../core",
- "../var/document"
-], function( jQuery, document ) {
+ "../var/document",
+ "../var/sort"
+], function( jQuery, document, sort ) {
"use strict";
hasDuplicate = false;
- results.sort( sortOrder );
+ sort.call( results, sortOrder );
if ( hasDuplicate ) {
while ( ( elem = results[ i++ ] ) ) {
--- /dev/null
+define( [
+ "./arr"
+], function( arr ) {
+ "use strict";
+
+ return arr.sort;
+} );