fix Ox.typeOf for Mobile Safari

This commit is contained in:
rlx 2012-05-24 15:24:13 +00:00
parent e2330a0e2e
commit d5962a972d

View file

@ -335,7 +335,8 @@ Ox.typeOf <f> Returns the type of a value
'undefined' 'undefined'
@*/ @*/
Ox.typeOf = function(val) { Ox.typeOf = function(val) {
// Mobile Safari doesn't like undefined here // Mobile Safari doesn't like null or undefined here
return val === void 0 ? 'undefined' return val === null ? 'null'
: val === void 0 ? 'undefined'
: Object.prototype.toString.call(val).slice(8, -1).toLowerCase(); : Object.prototype.toString.call(val).slice(8, -1).toLowerCase();
}; };