git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use the native isArray whenever possible. See perf test by jdalton here: http://jsper...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
81a920b
..
6e1f745
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-441,15
+441,13
@@
jQuery.extend({
return jQuery.type(obj) === "function";
},
return jQuery.type(obj) === "function";
},
- isArray: function( obj ) {
+ isArray: Array.isArray || function( obj ) {
return jQuery.type(obj) === "array";
},
type: 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();
},
toString.call(obj).slice(8, -1).toLowerCase();
},