Store last(path) in a var.

This commit is contained in:
jdalton
2015-04-08 08:41:57 -07:00
parent 7ec916b777
commit 3500b0016c

View File

@@ -9527,7 +9527,8 @@
if (!result && !isKey(path)) {
path = toPath(path);
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
result = object != null && hasOwnProperty.call(object, last(path));
path = last(path);
result = object != null && hasOwnProperty.call(object, path);
}
return result || (lodash.support.nonEnumStrings && isString(object) && isIndex(path, object.length));
}