git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' into csshooks
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
e1a3a6d
..
d6ef236
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-1,4
+1,4
@@
-(function() {
+var jQuery = (function() {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
// Define a local copy of jQuery
var jQuery = function( selector, context ) {
@@
-109,7
+109,7
@@
jQuery.fn = jQuery.prototype = {
}
} else {
}
} else {
- ret = buildFragment( [ match[1] ], [ doc ] );
+ ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
}
@@
-119,7
+119,9
@@
jQuery.fn = jQuery.prototype = {
} else {
elem = document.getElementById( match[2] );
} 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] ) {
// Handle the case where IE and Opera return items
// by name instead of ID
if ( elem.id !== match[2] ) {
@@
-438,18
+440,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 ) {
// 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
},
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;
}
return false;
}
@@
-594,7
+602,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)
// 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" || "setInterval" in array ) {
push.call( ret, array );
} else {
jQuery.merge( ret, array );
push.call( ret, array );
} else {
jQuery.merge( ret, array );
@@
-815,6
+826,6
@@
function doScrollCheck() {
}
// Expose jQuery to the global object
}
// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
+return window.jQuery = window.$ = jQuery;
})();
})();