fix Ox.typeOf
This commit is contained in:
parent
f46ff46da8
commit
5ad848c563
1 changed files with 29 additions and 31 deletions
|
@ -303,7 +303,7 @@ Ox.isUndefined = function(value) {
|
|||
Ox.typeOf <f> Returns the type of a value
|
||||
(value) -> <s> Type
|
||||
value <*> Any value
|
||||
> (function() { return Ox.typeOf(arguments); }())
|
||||
> Ox.typeOf((function() { return arguments; }()))
|
||||
'arguments'
|
||||
> Ox.typeOf([])
|
||||
'array'
|
||||
|
@ -341,9 +341,8 @@ Ox.typeOf = function(value) {
|
|||
// Internet Explorer 8 returns 'Object' instead of 'NodeList',
|
||||
// Internet Explorer 9 returns 'HTMLCollection' instead of 'NodeList',
|
||||
// Mobile Safari doesn't like null and undefined
|
||||
(function() {
|
||||
if (
|
||||
Ox.typeOf(arguments) != 'arguments'
|
||||
Ox.typeOf((function() { return arguments; }())) != 'arguments'
|
||||
|| Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist'
|
||||
|| Ox.typeOf(null) != 'null'
|
||||
|| Ox.typeOf() != 'undefined'
|
||||
|
@ -352,7 +351,7 @@ Ox.typeOf = function(value) {
|
|||
var ret = Object.prototype.toString.call(
|
||||
value
|
||||
).slice(8, -1).toLowerCase();
|
||||
if (typeof value.callee == 'function') {
|
||||
if (ret == 'object' && typeof value.callee == 'function') {
|
||||
ret = 'arguments';
|
||||
} else if (
|
||||
ret == 'htmlcollection' || (
|
||||
|
@ -370,4 +369,3 @@ Ox.typeOf = function(value) {
|
|||
return ret;
|
||||
};
|
||||
}
|
||||
})();
|
||||
|
|
Loading…
Reference in a new issue