(node: VNodeCall, context: CodegenContext)
| 815 | } |
| 816 | |
| 817 | function genVNodeCall(node: VNodeCall, context: CodegenContext) { |
| 818 | const { push, helper, pure } = context |
| 819 | const { |
| 820 | tag, |
| 821 | props, |
| 822 | children, |
| 823 | patchFlag, |
| 824 | dynamicProps, |
| 825 | directives, |
| 826 | isBlock, |
| 827 | disableTracking, |
| 828 | isComponent, |
| 829 | } = node |
| 830 | |
| 831 | class="cm">// add dev annotations to patch flags |
| 832 | let patchFlagString |
| 833 | if (patchFlag) { |
| 834 | if (__DEV__) { |
| 835 | if (patchFlag < 0) { |
| 836 | class="cm">// special flags (negative and mutually exclusive) |
| 837 | patchFlagString = patchFlag + ` /* ${PatchFlagNames[patchFlag]} */` |
| 838 | } else { |
| 839 | class="cm">// bitwise flags |
| 840 | const flagNames = Object.keys(PatchFlagNames) |
| 841 | .map(Number) |
| 842 | .filter(n => n > 0 && patchFlag & n) |
| 843 | .map(n => PatchFlagNames[n as PatchFlags]) |
| 844 | .join(`, `) |
| 845 | patchFlagString = patchFlag + ` /* ${flagNames} */` |
| 846 | } |
| 847 | } else { |
| 848 | patchFlagString = String(patchFlag) |
| 849 | } |
| 850 | } |
| 851 | |
| 852 | if (directives) { |
| 853 | push(helper(WITH_DIRECTIVES) + `(`) |
| 854 | } |
| 855 | if (isBlock) { |
| 856 | push(`(${helper(OPEN_BLOCK)}(${disableTracking ? `true` : ``}), `) |
| 857 | } |
| 858 | if (pure) { |
| 859 | push(PURE_ANNOTATION) |
| 860 | } |
| 861 | const callHelper: symbol = isBlock |
| 862 | ? getVNodeBlockHelper(context.inSSR, isComponent) |
| 863 | : getVNodeHelper(context.inSSR, isComponent) |
| 864 | push(helper(callHelper) + `(`, NewlineType.None, node) |
| 865 | genNodeList( |
| 866 | genNullableArgs([tag, props, children, patchFlagString, dynamicProps]), |
| 867 | context, |
| 868 | ) |
| 869 | push(`)`) |
| 870 | if (isBlock) { |
| 871 | push(`)`) |
| 872 | } |
| 873 | if (directives) { |
| 874 | push(`, `) |
no test coverage detected