X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fcore.js;h=9cb519be574742f1fa8a86f99a677262a9cda674;hb=c8dd49f756562fef68f664869952e4f5aab08acd;hp=227dc30d97c0ae53c8b9b7a6a821cd782955439e;hpb=ab454d9526445fa025b9c897ec2b21aa89babc8d;p=jquery.git diff --git a/src/core.js b/src/core.js index 227dc30..9cb519b 100644 --- a/src/core.js +++ b/src/core.js @@ -474,6 +474,11 @@ jQuery.extend({ return jQuery.type(obj) === "array"; }, + // A crude way of determining if an object is a window + isWindow: function( obj ) { + return "setInterval" in obj; + }, + type: function( obj ) { return obj == null ? String( obj ) : @@ -484,7 +489,7 @@ jQuery.extend({ // Must be an Object. // Because of IE, we also have to check the presence of the constructor property. // Make sure that DOM nodes and window objects don't pass through, as well - if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || obj.setInterval ) { + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { return false; } @@ -632,7 +637,7 @@ jQuery.extend({ // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 var type = jQuery.type(array); - if ( array.length == null || type === "string" || type === "function" || type === "regexp" || "setInterval" in array ) { + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { push.call( ret, array ); } else { jQuery.merge( ret, array );