( Ctor, propsData, data, context, children )
| 3051 | } |
| 3052 | |
| 3053 | function createFunctionalComponent ( |
| 3054 | Ctor, |
| 3055 | propsData, |
| 3056 | data, |
| 3057 | context, |
| 3058 | children |
| 3059 | ) { |
| 3060 | var props = {}; |
| 3061 | var propOptions = Ctor.options.props; |
| 3062 | if (propOptions) { |
| 3063 | for (var key in propOptions) { |
| 3064 | props[key] = validateProp(key, propOptions, propsData); |
| 3065 | } |
| 3066 | } |
| 3067 | // ensure the createElement function in functional components |
| 3068 | // gets a unique context - this is necessary for correct named slot check |
| 3069 | var _context = Object.create(context); |
| 3070 | var h = function (a, b, c, d) { return createElement(_context, a, b, c, d, true); }; |
| 3071 | var vnode = Ctor.options.render.call(null, h, { |
| 3072 | props: props, |
| 3073 | data: data, |
| 3074 | parent: context, |
| 3075 | children: children, |
| 3076 | slots: function () { return resolveSlots(children, context); } |
| 3077 | }); |
| 3078 | if (vnode instanceof VNode) { |
| 3079 | vnode.functionalContext = context; |
| 3080 | if (data.slot) { |
| 3081 | (vnode.data || (vnode.data = {})).slot = data.slot; |
| 3082 | } |
| 3083 | } |
| 3084 | return vnode |
| 3085 | } |
| 3086 | |
| 3087 | function createComponentInstanceForVnode ( |
| 3088 | vnode, // we know it's MountedComponentVNode but flow doesn't |
no test coverage detected