From 80549fe4e267a784415c22bb3ee8f12a37e3a2e5 Mon Sep 17 00:00:00 2001 From: rolux Date: Fri, 25 May 2012 19:45:07 +0200 Subject: [PATCH] handle FF 3.6 arguments 'object' --- source/Ox/js/Type.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 1f44fa91..caa785a5 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -338,12 +338,18 @@ Ox.typeOf = function(value) { return Object.prototype.toString.call(value).slice(8, -1).toLowerCase(); }; (function() { - // Internet Explorer returns 'HTMLCollection' instead of 'NodeList', + // Firefox 3.6 returns 'Object' instead of 'Arguments', + // Internet Explorer 9 returns 'HTMLCollection' instead of 'NodeList', // Mobile Safari doesn't like null and undefined var nodelist = Ox.typeOf(document.getElementsByTagName('a')); - if (nodelist != 'nodelist' || Ox.typeOf() != 'undefined') { + if ( + Ox.typeOf(arguments) != 'arguments' + && nodelist != 'nodelist' + || Ox.typeOf() != 'undefined' + ) { Ox.typeOf = function(value) { - var type = value === null ? 'null' + var type = value && Ox.hasOwn(value, 'callee') ? 'arguments' + : value === null ? 'null' : value === void 0 ? 'undefined' : Object.prototype.toString.call( value