Make _.isArguments fallback align with other array-like checks.

This commit is contained in:
John-David Dalton
2014-07-10 23:54:04 -07:00
parent a814d5438a
commit faa221f162

View File

@@ -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;
};
}