From faa221f16276ee7a028939dac5a445aea73069dc Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Thu, 10 Jul 2014 23:54:04 -0700 Subject: [PATCH] Make `_.isArguments` fallback align with other array-like checks. --- lodash.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lodash.js b/lodash.js index 2d7f396a1..a635586ec 100644 --- a/lodash.js +++ b/lodash.js @@ -6799,7 +6799,8 @@ // fallback for environments without a `[[Class]]` for `arguments` objects if (!support.argsClass) { isArguments = function(value) { - return (value && typeof value == 'object' && typeof value.length == 'number' && + var length = (value && typeof value == 'object') ? value.length : undefined; + return (typeof length == 'number' && length > -1 && length <= MAX_SAFE_INTEGER && hasOwnProperty.call(value, 'callee') && !propertyIsEnumerable.call(value, 'callee')) || false; }; }