Skip to content

Commit

Permalink
Fixin scope range for var declarations in hasPath and hasPathIn.
Browse files Browse the repository at this point in the history
  • Loading branch information
falsyvalues committed Apr 4, 2017
1 parent 96ebd44 commit 7c92111
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions hasPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
5 changes: 3 additions & 2 deletions hasPathIn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 7c92111

Please sign in to comment.