fix typeOf(window) for recent version of Firefox
This commit is contained in:
parent
2bc7b80f0d
commit
e582ee5fac
1 changed files with 4 additions and 0 deletions
|
@ -409,10 +409,12 @@ Ox.typeOf = function(value) {
|
||||||
// Internet Explorer 8 returns 'Object' for nodelists,
|
// Internet Explorer 8 returns 'Object' for nodelists,
|
||||||
// Internet Explorer 9 returns 'HTMLCollection' for nodelists,
|
// Internet Explorer 9 returns 'HTMLCollection' for nodelists,
|
||||||
// Mobile Safari returns 'DOMWindow' for null and undefined
|
// Mobile Safari returns 'DOMWindow' for null and undefined
|
||||||
|
// Firefox 30+ returns 'window' for window
|
||||||
if (
|
if (
|
||||||
Ox.typeOf((function() { return arguments; }())) != 'arguments'
|
Ox.typeOf((function() { return arguments; }())) != 'arguments'
|
||||||
|| Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist'
|
|| Ox.typeOf(document.getElementsByTagName('a')) != 'nodelist'
|
||||||
|| Ox.typeOf(null) != 'null'
|
|| Ox.typeOf(null) != 'null'
|
||||||
|
|| Ox.typeOf(window) != 'global'
|
||||||
|| Ox.typeOf() != 'undefined'
|
|| Ox.typeOf() != 'undefined'
|
||||||
) {
|
) {
|
||||||
Ox.typeOf = function(value) {
|
Ox.typeOf = function(value) {
|
||||||
|
@ -423,6 +425,8 @@ if (
|
||||||
type = 'null';
|
type = 'null';
|
||||||
} else if (value === void 0) {
|
} else if (value === void 0) {
|
||||||
type = 'undefined';
|
type = 'undefined';
|
||||||
|
} else if (value === window) {
|
||||||
|
type = 'window';
|
||||||
} else if (type == 'object' && typeof value.callee == 'function') {
|
} else if (type == 'object' && typeof value.callee == 'function') {
|
||||||
type = 'arguments';
|
type = 'arguments';
|
||||||
} else if (
|
} else if (
|
||||||
|
|
Loading…
Reference in a new issue