mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-01-31 15:27:50 +00:00
Only check indexes for arrays in _.keysIn dense array support.
This commit is contained in:
18
lodash.js
18
lodash.js
@@ -6544,23 +6544,23 @@
|
||||
if (!isObject(object)) {
|
||||
return [];
|
||||
}
|
||||
var length = object.length;
|
||||
var isArr,
|
||||
keyIndex,
|
||||
length = object.length;
|
||||
|
||||
length = (typeof length == 'number' && length > 0 &&
|
||||
(isArray(object) || (support.nonEnumStrings && isString(object)) ||
|
||||
((isArr = isArray(object)) || (support.nonEnumStrings && isString(object)) ||
|
||||
(support.nonEnumArgs && isArguments(object))) && length) >>> 0;
|
||||
|
||||
var keyIndex,
|
||||
var index = -1,
|
||||
maxIndex = length - 1,
|
||||
result = Array(length),
|
||||
skipIndexes = length > 0,
|
||||
skipIndexes = isArr && length > 0,
|
||||
skipErrorProps = support.enumErrorProps && (object === errorProto || object instanceof Error),
|
||||
skipProto = support.enumPrototypes && typeof object == 'function';
|
||||
|
||||
if (skipIndexes) {
|
||||
var index = -1;
|
||||
while (++index < length) {
|
||||
result[index] = String(index);
|
||||
}
|
||||
while (++index < length) {
|
||||
result[index] = String(index);
|
||||
}
|
||||
for (var key in object) {
|
||||
if (!(skipProto && key == 'prototype') &&
|
||||
|
||||
Reference in New Issue
Block a user