( rawSlots: RawSlots, slots: InternalSlots, instance: ComponentInternalInstance, )
| 119 | } |
| 120 | |
| 121 | const normalizeObjectSlots = ( |
| 122 | rawSlots: RawSlots, |
| 123 | slots: InternalSlots, |
| 124 | instance: ComponentInternalInstance, |
| 125 | ) => { |
| 126 | const ctx = rawSlots._ctx |
| 127 | for (const key in rawSlots) { |
| 128 | if (isInternalKey(key)) continue |
| 129 | const value = rawSlots[key] |
| 130 | if (isFunction(value)) { |
| 131 | slots[key] = normalizeSlot(key, value, ctx) |
| 132 | } else if (value != null) { |
| 133 | if ( |
| 134 | __DEV__ && |
| 135 | !( |
| 136 | __COMPAT__ && |
| 137 | isCompatEnabled(DeprecationTypes.RENDER_FUNCTION, instance) |
| 138 | ) |
| 139 | ) { |
| 140 | warn( |
| 141 | `Non-function value encountered for slot "${key}". ` + |
| 142 | `Prefer function slots for better performance.`, |
| 143 | ) |
| 144 | } |
| 145 | const normalized = normalizeSlotValue(value) |
| 146 | slots[key] = () => normalized |
| 147 | } |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | const normalizeVNodeSlots = ( |
| 152 | instance: ComponentInternalInstance, |
no test coverage detected