X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=c865bfb9a195ff27a9bd04ea84529824c63bd394;hb=93fdbeb963a9c350f807818c7cc99982942a92f3;hp=4091111a944aa0bfffab3d5ea920bd8ea22a2b5e;hpb=87ba780c69ac1af04afc40f2da39282d917f9108;p=jquery.git diff --git a/src/core.js b/src/core.js index 4091111..c865bfb 100644 --- a/src/core.js +++ b/src/core.js @@ -29,7 +29,7 @@ var jQuery = function( selector, context ) { rnotwhite = /\S/, // Used for trimming whitespace - rtrim = /(\s|\u00A0)+|(\s|\u00A0)+$/g, + rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g, // Match a standalone tag rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, @@ -342,14 +342,6 @@ jQuery.extend({ return true; }, - // check if an element is in a (or is an) XML document - isXMLDoc: function( elem ) { - // documentElement is verified for cases where it doesn't yet exist - // (such as loading iframes in IE - #4833) - var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement; - return documentElement ? documentElement.nodeName !== "HTML" : false; - }, - // Evalulates a script in a global context globalEval: function( data ) { if ( data && rnotwhite.test(data) ) { @@ -425,7 +417,9 @@ jQuery.extend({ if ( array != null ) { // The window, strings (and functions) also have 'length' - if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || array.setInterval ) { + // The extra typeof function check is to prevent crashes + // in Safari 2 (See: #3039) + if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { push.call( ret, array ); } else { jQuery.merge( ret, array );