cleanup: rm iQ.makeArray

This commit is contained in:
Michael Yoshitaka Erlewine 2010-07-13 17:39:46 -04:00
parent 1edcad44f0
commit 8e181c230e

View File

@ -201,7 +201,20 @@ iQ.fn = iQ.prototype = {
this.context = selector.context;
}
return iQ.makeArray( selector, this );
// this used to be makeArray:
var ret = this || [];
if ( selector != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
if ( selector.length == null || typeof selector === "string" || iQ.isFunction(selector) || (typeof selector !== "function" && selector.setInterval) ) {
push.call( ret, selector );
} else {
iQ.merge( ret, selector );
}
}
return ret;
},
// Start with an empty selector
@ -962,26 +975,6 @@ iQ.extend({
return (text || "").replace( rtrim, "" );
},
// ----------
// Function: makeArray
// results is for internal usage only
makeArray: function( array, results ) {
var ret = results || [];
if ( array != null ) {
// The window, strings (and functions) also have 'length'
// The extra typeof function check is to prevent crashes
// in Safari 2 (See: #3039)
if ( array.length == null || typeof array === "string" || iQ.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
push.call( ret, array );
} else {
iQ.merge( ret, array );
}
}
return ret;
},
// ----------
// Function: inArray
inArray: function( elem, array ) {