fix typeOf(window) for recent version of Firefox

This commit is contained in:
rolux 2014-09-02 13:21:55 +02:00
parent 2bc7b80f0d
commit e582ee5fac

View file

@ -409,10 +409,12 @@ Ox.typeOf = function(value) {
// Internet Explorer 8 returns 'Object' for nodelists,
// Internet Explorer 9 returns 'HTMLCollection' for nodelists,
// Mobile Safari returns 'DOMWindow' for null and undefined
// Firefox 30+ returns 'window' for window
if (
Ox.typeOf((function() { return arguments; }())) != 'arguments'
|| Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist'
|| Ox.typeOf(null) != 'null'
|| Ox.typeOf(window) != 'global'
|| Ox.typeOf() != 'undefined'
) {
Ox.typeOf = function(value) {
@ -423,6 +425,8 @@ if (
type = 'null';
} else if (value === void 0) {
type = 'undefined';
} else if (value === window) {
type = 'window';
} else if (type == 'object' && typeof value.callee == 'function') {
type = 'arguments';
} else if (