(thing, prop)
| 28 | * @returns {boolean} True when `prop` is owned below Object.prototype |
| 29 | */ |
| 30 | const hasOwnInPrototypeChain = (thing, prop) => { |
| 31 | let obj = thing; |
| 32 | const seen = []; |
| 33 | |
| 34 | while (obj != null && obj !== Object.prototype) { |
| 35 | if (seen.indexOf(obj) !== -1) { |
| 36 | return false; |
| 37 | } |
| 38 | seen.push(obj); |
| 39 | |
| 40 | if (hasOwnProperty(obj, prop)) { |
| 41 | return true; |
| 42 | } |
| 43 | obj = getPrototypeOf(obj); |
| 44 | } |
| 45 | return false; |
| 46 | }; |
| 47 | |
| 48 | /** |
| 49 | * Read `obj[prop]` only when it is safe from Object.prototype pollution. Own |
no test coverage detected