mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Cleanup _.keysIn.
This commit is contained in:
14
lodash.js
14
lodash.js
@@ -8042,25 +8042,23 @@
|
|||||||
// attribute of an existing property and the `constructor` property of a
|
// attribute of an existing property and the `constructor` property of a
|
||||||
// prototype defaults to non-enumerable.
|
// prototype defaults to non-enumerable.
|
||||||
for (var key in object) {
|
for (var key in object) {
|
||||||
if (!(key == 'constructor' && (isProto || (Ctor === proto[key] && !hasOwnProperty.call(object, key)))) &&
|
if (!(skipProto && key == 'prototype') &&
|
||||||
!(skipProto && key == 'prototype') &&
|
|
||||||
!(skipErrorProps && (key == 'message' || key == 'name')) &&
|
!(skipErrorProps && (key == 'message' || key == 'name')) &&
|
||||||
!(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex < length && keyIndex % 1 == 0))) {
|
!(skipIndexes && (keyIndex = +key, keyIndex > -1 && keyIndex < length && keyIndex % 1 == 0)) &&
|
||||||
|
!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {
|
||||||
result.push(key);
|
result.push(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (support.nonEnumShadows && object !== objectProto) {
|
if (support.nonEnumShadows && object !== objectProto) {
|
||||||
index = -1;
|
|
||||||
length = shadowedProps.length;
|
|
||||||
|
|
||||||
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
|
var className = object === stringProto ? stringClass : object === errorProto ? errorClass : toString.call(object),
|
||||||
nonEnum = nonEnumProps[className] || nonEnumProps[objectClass];
|
nonEnum = nonEnumProps[className] || nonEnumProps[objectClass];
|
||||||
|
|
||||||
if (className == objectClass) {
|
if (className == objectClass) {
|
||||||
proto = objectProto;
|
proto = objectProto;
|
||||||
}
|
}
|
||||||
while (++index < length) {
|
length = shadowedProps.length;
|
||||||
key = shadowedProps[index];
|
while (length--) {
|
||||||
|
key = shadowedProps[length];
|
||||||
if (!(isProto && nonEnum[key]) &&
|
if (!(isProto && nonEnum[key]) &&
|
||||||
(key == 'constructor' ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) {
|
(key == 'constructor' ? hasOwnProperty.call(object, key) : object[key] !== proto[key])) {
|
||||||
result.push(key);
|
result.push(key);
|
||||||
|
|||||||
Reference in New Issue
Block a user