Fixin scope range for var declarations in internal version of hasPath.

This commit is contained in:
Michał Lipiński
2017-04-06 22:44:15 +02:00
parent b506174410
commit 99fb4c8ff7

View File

@@ -17,11 +17,12 @@ function hasPath(object, path, hasFunc) {
path = castPath(path, object)
let index = -1
let length = path.length
let { length } = path
let result = false
let key
while (++index < length) {
const key = toKey(path[index])
key = toKey(path[index])
if (!(result = object != null && hasFunc(object, key))) {
break
}