X-Git-Url: http://git.asbjorn.it/?a=blobdiff_plain;f=src%2Fcore.js;h=f5c27561b2fc44a0297f3cbc5611df3d1713f15a;hb=13f27fcd05987dc8951621ea55795fde792d7b79;hp=5a005556239c376990be52733e617154f71b01c6;hpb=94f35d05199ec1634d9c8c60d10f298f260056bd;p=jquery.git diff --git a/src/core.js b/src/core.js index 5a00555..f5c2756 100644 --- a/src/core.js +++ b/src/core.js @@ -119,7 +119,9 @@ jQuery.fn = jQuery.prototype = { } else { elem = document.getElementById( match[2] ); - if ( elem ) { + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { // Handle the case where IE and Opera return items // by name instead of ID if ( elem.id !== match[2] ) { @@ -441,12 +443,14 @@ jQuery.extend({ return jQuery.type(obj) === "function"; }, - isArray: function( obj ) { + isArray: Array.isArray || function( obj ) { return jQuery.type(obj) === "array"; }, type: function( obj ) { - return toString.call(obj).slice(8, -1).toLowerCase(); + return obj == null ? + String( obj ) : + toString.call(obj).slice(8, -1).toLowerCase(); }, isPlainObject: function( obj ) { @@ -601,7 +605,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" || (typeof type !== "function" && array.setInterval) ) { + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || "setInterval" in array ) { push.call( ret, array ); } else { jQuery.merge( ret, array );