mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-12 03:47:50 +00:00
Make _.isArguments length check consistent with its fallback.
This commit is contained in:
@@ -7027,7 +7027,8 @@
|
|||||||
* // => false
|
* // => false
|
||||||
*/
|
*/
|
||||||
function isArguments(value) {
|
function isArguments(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 &&
|
||||||
toString.call(value) == argsClass) || false;
|
toString.call(value) == argsClass) || false;
|
||||||
}
|
}
|
||||||
// fallback for environments without a `[[Class]]` for `arguments` objects
|
// fallback for environments without a `[[Class]]` for `arguments` objects
|
||||||
|
|||||||
Reference in New Issue
Block a user