Make sure that the removeEvent and buildFragment private functions are exposed (to...
[jquery.git] / src / core.js
index 81a920b..65d32a3 100644 (file)
@@ -109,7 +109,7 @@ jQuery.fn = jQuery.prototype = {
                                                }
 
                                        } else {
-                                               ret = buildFragment( [ match[1] ], [ doc ] );
+                                               ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
                                                selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
                                        }
                                        
@@ -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,15 +443,13 @@ jQuery.extend({
                return jQuery.type(obj) === "function";
        },
 
-       isArray: function( obj ) {
+       isArray: Array.isArray || function( obj ) {
                return jQuery.type(obj) === "array";
        },
 
        type: function( obj ) {
-               return obj === null ?
-                       "null" :
-                       obj === undefined ?
-                       "undefined" :
+               return obj == null ?
+                       String( obj ) :
                        toString.call(obj).slice(8, -1).toLowerCase();
        },
 
@@ -605,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 );