From 43878e8ef0d4370054cd9aab297b3f0a55ac0722 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 24 Oct 2011 11:28:26 -0400 Subject: [PATCH] Merging in #321 --- underscore.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/underscore.js b/underscore.js index 5d2aece34..72237d180 100644 --- a/underscore.js +++ b/underscore.js @@ -758,16 +758,15 @@ }; // Is a given variable an arguments object? - _.isArguments = toString.call(arguments) == '[object Arguments]' - ? function(obj) { + if (toString.call(arguments) == '[object Arguments]') { + _.isArguments = function(obj) { return toString.call(obj) == '[object Arguments]'; - } - : function(obj) { - return obj - ? hasOwnProperty.call(obj, 'callee') - && hasOwnProperty.call(obj, 'length') - : false; }; + } else { + _.isArguments = function(obj) { + return !!(obj && hasOwnProperty.call(obj, 'callee')); + }; + } // Is a given value a function? _.isFunction = function(obj) {