(obj, propertyName)
| 77 | } |
| 78 | |
| 79 | const combineAncestralObject = function (obj, propertyName) { |
| 80 | const combined = {} |
| 81 | while (obj != null ? obj[propertyName] : undefined) { |
| 82 | for (const key in obj[propertyName]) { |
| 83 | const value = obj[propertyName][key] |
| 84 | if (combined[key]) { continue } |
| 85 | combined[key] = value |
| 86 | } |
| 87 | if (obj.__proto__) { |
| 88 | obj = obj.__proto__ |
| 89 | } else { |
| 90 | // IE has no __proto__. TODO: does this even work? At most it doesn't crash. |
| 91 | obj = Object.getPrototypeOf(obj) |
| 92 | } |
| 93 | } |
| 94 | return combined |
| 95 | } |
| 96 | |
| 97 | // Walk a key chain down to the value. Can optionally set newValue instead. |
| 98 | // Same as in world_utils, but don't want mutual imports |
nothing calls this directly
no outgoing calls
no test coverage detected