MCPcopy
hub / github.com/nwjs/nw.js / createComponent

Function createComponent

test/sanity/issue7197-load/js/chunk-vendors.6e82bc79.js:3665–3760  ·  view source on GitHub ↗
(
  Ctor,
  data,
  context,
  children,
  tag
)

Source from the content-addressed store, hash-verified

3663var hooksToMerge = Object.keys(componentVNodeHooks);
3664
3665function createComponent (
3666 Ctor,
3667 data,
3668 context,
3669 children,
3670 tag
3671) {
3672 if (isUndef(Ctor)) {
3673 return
3674 }
3675
3676 var baseCtor = context.$options._base;
3677
3678 // plain options object: turn it into a constructor
3679 if (isObject(Ctor)) {
3680 Ctor = baseCtor.extend(Ctor);
3681 }
3682
3683 // if at this stage it's not a constructor or an async component factory,
3684 // reject.
3685 if (typeof Ctor !== 'function') {
3686 if (false) {}
3687 return
3688 }
3689
3690 // async component
3691 var asyncFactory;
3692 if (isUndef(Ctor.cid)) {
3693 asyncFactory = Ctor;
3694 Ctor = resolveAsyncComponent(asyncFactory, baseCtor);
3695 if (Ctor === undefined) {
3696 // return a placeholder node for async component, which is rendered
3697 // as a comment node but preserves all the raw information for the node.
3698 // the information will be used for async server-rendering and hydration.
3699 return createAsyncPlaceholder(
3700 asyncFactory,
3701 data,
3702 context,
3703 children,
3704 tag
3705 )
3706 }
3707 }
3708
3709 data = data || {};
3710
3711 // resolve constructor options in case global mixins are applied after
3712 // component constructor creation
3713 resolveConstructorOptions(Ctor);
3714
3715 // transform component v-model data into props & events
3716 if (isDef(data.model)) {
3717 transformModel(Ctor.options, data);
3718 }
3719
3720 // extract props
3721 var propsData = extractPropsFromVNodeData(data, Ctor, tag);
3722

Callers 2

_createElementFunction · 0.85
createElmFunction · 0.85

Calls 15

isUndefFunction · 0.85
isObjectFunction · 0.85
resolveAsyncComponentFunction · 0.85
createAsyncPlaceholderFunction · 0.85
isDefFunction · 0.85
transformModelFunction · 0.85
isTrueFunction · 0.85
installComponentHooksFunction · 0.85
iFunction · 0.85

Tested by

no test coverage detected