mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Clarify bug comment of baseHas. [ci skip]
This commit is contained in:
@@ -2511,8 +2511,9 @@
|
|||||||
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
* @returns {boolean} Returns `true` if `key` exists, else `false`.
|
||||||
*/
|
*/
|
||||||
function baseHas(object, key) {
|
function baseHas(object, key) {
|
||||||
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`
|
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
|
||||||
// incorrectly report `false` for own index properties.
|
// that are composed entirely of index properties, return `false` for
|
||||||
|
// `hasOwnProperty` checks of them.
|
||||||
return hasOwnProperty.call(object, key) ||
|
return hasOwnProperty.call(object, key) ||
|
||||||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null);
|
(typeof object == 'object' && key in object && getPrototypeOf(object) === null);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user