git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Added some tweaks to $.type to handle null and undefined. Added a bunch of unit tests...
[jquery.git]
/
src
/
core.js
diff --git
a/src/core.js
b/src/core.js
index
5a00555
..
81a920b
100644
(file)
--- a/
src/core.js
+++ b/
src/core.js
@@
-446,7
+446,11
@@
jQuery.extend({
},
type: function( obj ) {
- return toString.call(obj).slice(8, -1).toLowerCase();
+ return obj === null ?
+ "null" :
+ obj === undefined ?
+ "undefined" :
+ toString.call(obj).slice(8, -1).toLowerCase();
},
isPlainObject: function( obj ) {