From 4f5a2e8072cbf0be4296f4596f4e0fdaf92c4d95 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 17 Feb 2012 10:30:47 +0000 Subject: [PATCH] fix Ox.isArguments --- source/Ox/js/Type.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/source/Ox/js/Type.js b/source/Ox/js/Type.js index 8da157ff..a1586729 100644 --- a/source/Ox/js/Type.js +++ b/source/Ox/js/Type.js @@ -7,11 +7,16 @@ Ox.isArguments Tests if a value is an arguments "array" > Ox.isArguments((function() { return arguments; }())) true @*/ -Ox.isArguments = /MSIE/.test(navigator.userAgent) ? function(val) { - return !!(val && Object.hasOwnProperty.call(val, 'callee')); -} : function(val) { +Ox.isArguments = function(val) { return !!(val && val.toString() == '[object Arguments]'); } +if (!(function() { + return Ox.isArguments(arguments); +}())) { + Ox.isArguments = function(val) { + return !!(val && Object.hasOwnProperty.call(val, 'callee')); + }; +} /*@ Ox.isArray Tests if a value is an array