(
data,
props,
children,
parent,
Ctor
)
| 2959 | /* */ |
| 2960 | |
| 2961 | function FunctionalRenderContext ( |
| 2962 | data, |
| 2963 | props, |
| 2964 | children, |
| 2965 | parent, |
| 2966 | Ctor |
| 2967 | ) { |
| 2968 | var this$1 = this; |
| 2969 | |
| 2970 | var options = Ctor.options; |
| 2971 | // ensure the createElement function in functional components |
| 2972 | // gets a unique context - this is necessary for correct named slot check |
| 2973 | var contextVm; |
| 2974 | if (hasOwn(parent, '_uid')) { |
| 2975 | contextVm = Object.create(parent); |
| 2976 | // $flow-disable-line |
| 2977 | contextVm._original = parent; |
| 2978 | } else { |
| 2979 | // the context vm passed in is a functional context as well. |
| 2980 | // in this case we want to make sure we are able to get a hold to the |
| 2981 | // real context instance. |
| 2982 | contextVm = parent; |
| 2983 | // $flow-disable-line |
| 2984 | parent = parent._original; |
| 2985 | } |
| 2986 | var isCompiled = isTrue(options._compiled); |
| 2987 | var needNormalization = !isCompiled; |
| 2988 | |
| 2989 | this.data = data; |
| 2990 | this.props = props; |
| 2991 | this.children = children; |
| 2992 | this.parent = parent; |
| 2993 | this.listeners = data.on || emptyObject; |
| 2994 | this.injections = resolveInject(options.inject, parent); |
| 2995 | this.slots = function () { |
| 2996 | if (!this$1.$slots) { |
| 2997 | normalizeScopedSlots( |
| 2998 | data.scopedSlots, |
| 2999 | this$1.$slots = resolveSlots(children, parent) |
| 3000 | ); |
| 3001 | } |
| 3002 | return this$1.$slots |
| 3003 | }; |
| 3004 | |
| 3005 | Object.defineProperty(this, 'scopedSlots', ({ |
| 3006 | enumerable: true, |
| 3007 | get: function get () { |
| 3008 | return normalizeScopedSlots(data.scopedSlots, this.slots()) |
| 3009 | } |
| 3010 | })); |
| 3011 | |
| 3012 | // support for compiled functional template |
| 3013 | if (isCompiled) { |
| 3014 | // exposing $options for renderStatic() |
| 3015 | this.$options = options; |
| 3016 | // pre-resolve slots for renderSlot() |
| 3017 | this.$slots = this.slots(); |
| 3018 | this.$scopedSlots = normalizeScopedSlots(data.scopedSlots, this.$slots); |
nothing calls this directly
no test coverage detected