X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=6e1f74520d9c0fa8407e67b1d9ab16d1e6e7dd83;hb=ea8b1584b1905bbb414dc2e3cf562c6f3904bd97;hp=e1a3a6df2523b0d335cbfcf1ebe114513efbc186;hpb=b3ccf2f2881d9ad988aba1cf3ccffb810063ab29;p=jquery.git diff --git a/src/core.js b/src/core.js index e1a3a6d..6e1f745 100644 --- a/src/core.js +++ b/src/core.js @@ -438,18 +438,24 @@ jQuery.extend({ // Since version 1.3, DOM methods and functions like alert // aren't supported. They return false on IE (#2968). isFunction: function( obj ) { - return toString.call(obj) === "[object Function]"; + return jQuery.type(obj) === "function"; }, - isArray: function( obj ) { - return toString.call(obj) === "[object Array]"; + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + type: function( obj ) { + return obj == null ? + String( obj ) : + toString.call(obj).slice(8, -1).toLowerCase(); }, isPlainObject: function( obj ) { // 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 || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) { + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || obj.setInterval ) { return false; } @@ -594,7 +600,10 @@ jQuery.extend({ // 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" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) { + // 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" || (typeof type !== "function" && array.setInterval) ) { push.call( ret, array ); } else { jQuery.merge( ret, array );