mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-08 18:17:48 +00:00
Fix failing _.has tests in Rhino.
This commit is contained in:
@@ -9666,17 +9666,21 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
var result = hasOwnProperty.call(object, path);
|
var result = hasOwnProperty.call(object, path);
|
||||||
|
if (!result && !isKey(path)) {
|
||||||
|
path = toPath(path);
|
||||||
|
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
||||||
|
if (object == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
path = last(path);
|
||||||
|
result = hasOwnProperty.call(object, path);
|
||||||
|
}
|
||||||
if (result) {
|
if (result) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
if (isKey(path)) {
|
var length = object.length;
|
||||||
var length = object.length;
|
return isLength(length) && isIndex(path, length) &&
|
||||||
return isLength(length) && isIndex(path, length) &&
|
(isArray(object) || isArguments(object) || isString(object));
|
||||||
(isArray(object) || isArguments(object) || isString(object));
|
|
||||||
}
|
|
||||||
path = toPath(path);
|
|
||||||
object = path.length == 1 ? object : baseGet(object, baseSlice(path, 0, -1));
|
|
||||||
return object != null && hasOwnProperty.call(object, last(path));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user