diff options
Diffstat (limited to 'tools/eslint/node_modules/lodash/_hasPath.js')
-rw-r--r-- | tools/eslint/node_modules/lodash/_hasPath.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/eslint/node_modules/lodash/_hasPath.js b/tools/eslint/node_modules/lodash/_hasPath.js index 1e2c3eac4f..770be4b889 100644 --- a/tools/eslint/node_modules/lodash/_hasPath.js +++ b/tools/eslint/node_modules/lodash/_hasPath.js @@ -18,9 +18,9 @@ var castPath = require('./_castPath'), function hasPath(object, path, hasFunc) { path = isKey(path, object) ? [path] : castPath(path); - var result, - index = -1, - length = path.length; + var index = -1, + length = path.length, + result = false; while (++index < length) { var key = toKey(path[index]); @@ -29,10 +29,10 @@ function hasPath(object, path, hasFunc) { } object = object[key]; } - if (result) { + if (result || ++index != length) { return result; } - var length = object ? object.length : 0; + length = object ? object.length : 0; return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } |