( key: string, rawSlot: Function, ctx: ComponentInternalInstance | null | undefined, )
| 90 | : [normalizeVNode(value as VNodeChild)] |
| 91 | |
| 92 | const normalizeSlot = ( |
| 93 | key: string, |
| 94 | rawSlot: Function, |
| 95 | ctx: ComponentInternalInstance | null | undefined, |
| 96 | ): Slot => { |
| 97 | if ((rawSlot as any)._n) { |
| 98 | // already normalized - #5353 |
| 99 | return rawSlot as Slot |
| 100 | } |
| 101 | const normalized = withCtx((...args: any[]) => { |
| 102 | if ( |
| 103 | __DEV__ && |
| 104 | currentInstance && |
| 105 | !(ctx === null && currentRenderingInstance) && |
| 106 | !(ctx && ctx.root !== currentInstance.root) |
| 107 | ) { |
| 108 | warn( |
| 109 | `Slot "${key}" invoked outside of the render function: ` + |
| 110 | `this will not track dependencies used in the slot. ` + |
| 111 | `Invoke the slot function inside the render function instead.`, |
| 112 | ) |
| 113 | } |
| 114 | return normalizeSlotValue(rawSlot(...args)) |
| 115 | }, ctx) as Slot |
| 116 | // NOT a compiled slot |
| 117 | ;(normalized as ContextualRenderFn)._c = false |
| 118 | return normalized |
| 119 | } |
| 120 | |
| 121 | const normalizeObjectSlots = ( |
| 122 | rawSlots: RawSlots, |
no test coverage detected