diff --git a/browser/base/content/tabview/iq.js b/browser/base/content/tabview/iq.js index a9a4a0603cc..8136e77e4f1 100644 --- a/browser/base/content/tabview/iq.js +++ b/browser/base/content/tabview/iq.js @@ -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 ) {