( instance: ComponentInternalInstance, children: VNodeNormalizedChildren, optimized: boolean, )
| 183 | } |
| 184 | |
| 185 | export const initSlots = ( |
| 186 | instance: ComponentInternalInstance, |
| 187 | children: VNodeNormalizedChildren, |
| 188 | optimized: boolean, |
| 189 | ): void => { |
| 190 | const slots = (instance.slots = createInternalObject()) |
| 191 | if (instance.vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) { |
| 192 | const type = (children as RawSlots)._ |
| 193 | if (type) { |
| 194 | assignSlots(slots, children as Slots, optimized) |
| 195 | // make compiler marker non-enumerable |
| 196 | if (optimized) { |
| 197 | def(slots, '_', type, true) |
| 198 | } |
| 199 | } else { |
| 200 | normalizeObjectSlots(children as RawSlots, slots, instance) |
| 201 | } |
| 202 | } else if (children) { |
| 203 | normalizeVNodeSlots(instance, children) |
| 204 | } |
| 205 | } |
| 206 | |
| 207 | export const updateSlots = ( |
| 208 | instance: ComponentInternalInstance, |
no test coverage detected