Clarify bug comment of baseHas. [ci skip]

This commit is contained in:
John-David Dalton
2015-10-06 20:11:31 -07:00
parent afb66f4b8a
commit f880e39838

View File

@@ -2511,8 +2511,9 @@
* @returns {boolean} Returns `true` if `key` exists, else `false`.
*/
function baseHas(object, key) {
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`
// incorrectly report `false` for own index properties.
// Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`,
// that are composed entirely of index properties, return `false` for
// `hasOwnProperty` checks of them.
return hasOwnProperty.call(object, key) ||
(typeof object == 'object' && key in object && getPrototypeOf(object) === null);
}