Fixin scope range for var declarations in hasPath and hasPathIn.

This commit is contained in:
Michał Lipiński
2017-04-04 20:37:52 +02:00
parent 96ebd44509
commit 7c92111067
2 changed files with 6 additions and 4 deletions

View File

@@ -31,11 +31,12 @@ function hasPath(object, path) {
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 && hasOwnProperty.call(object, key))) {
break
}

View File

@@ -28,11 +28,12 @@ function hasPathIn(object, path) {
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 && key in Object(object))) {
break
}