btea 1 год назад
Родитель
Сommit
fe2ab1bbac
2 измененных файлов с 1 добавлено и 6 удалено
  1. 0 3
      packages/compiler-core/src/transform.ts
  2. 1 3
      packages/compiler-core/src/transforms/vIf.ts

+ 0 - 3
packages/compiler-core/src/transform.ts

@@ -23,7 +23,6 @@ import {
 import {
 import {
   EMPTY_OBJ,
   EMPTY_OBJ,
   NOOP,
   NOOP,
-  PatchFlagNames,
   PatchFlags,
   PatchFlags,
   camelize,
   camelize,
   capitalize,
   capitalize,
@@ -375,7 +374,6 @@ function createRootCodegen(root: RootNode, context: TransformContext) {
   } else if (children.length > 1) {
   } else if (children.length > 1) {
     // root has multiple nodes - return a fragment block.
     // root has multiple nodes - return a fragment block.
     let patchFlag = PatchFlags.STABLE_FRAGMENT
     let patchFlag = PatchFlags.STABLE_FRAGMENT
-    let patchFlagText = PatchFlagNames[PatchFlags.STABLE_FRAGMENT]
     // check if the fragment actually contains a single valid child with
     // check if the fragment actually contains a single valid child with
     // the rest being comments
     // the rest being comments
     if (
     if (
@@ -383,7 +381,6 @@ function createRootCodegen(root: RootNode, context: TransformContext) {
       children.filter(c => c.type !== NodeTypes.COMMENT).length === 1
       children.filter(c => c.type !== NodeTypes.COMMENT).length === 1
     ) {
     ) {
       patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT
       patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT
-      patchFlagText += `, ${PatchFlagNames[PatchFlags.DEV_ROOT_FRAGMENT]}`
     }
     }
     root.codegenNode = createVNodeCall(
     root.codegenNode = createVNodeCall(
       context,
       context,

+ 1 - 3
packages/compiler-core/src/transforms/vIf.ts

@@ -32,7 +32,7 @@ import { processExpression } from './transformExpression'
 import { validateBrowserExpression } from '../validateExpression'
 import { validateBrowserExpression } from '../validateExpression'
 import { CREATE_COMMENT, FRAGMENT } from '../runtimeHelpers'
 import { CREATE_COMMENT, FRAGMENT } from '../runtimeHelpers'
 import { findDir, findProp, getMemoedVNodeCall, injectProp } from '../utils'
 import { findDir, findProp, getMemoedVNodeCall, injectProp } from '../utils'
-import { PatchFlagNames, PatchFlags } from '@vue/shared'
+import { PatchFlags } from '@vue/shared'
 
 
 export const transformIf: NodeTransform = createStructuralDirectiveTransform(
 export const transformIf: NodeTransform = createStructuralDirectiveTransform(
   /^(if|else|else-if)$/,
   /^(if|else|else-if)$/,
@@ -264,7 +264,6 @@ function createChildrenCodegenNode(
       return vnodeCall
       return vnodeCall
     } else {
     } else {
       let patchFlag = PatchFlags.STABLE_FRAGMENT
       let patchFlag = PatchFlags.STABLE_FRAGMENT
-      let patchFlagText = PatchFlagNames[PatchFlags.STABLE_FRAGMENT]
       // check if the fragment actually contains a single valid child with
       // check if the fragment actually contains a single valid child with
       // the rest being comments
       // the rest being comments
       if (
       if (
@@ -273,7 +272,6 @@ function createChildrenCodegenNode(
         children.filter(c => c.type !== NodeTypes.COMMENT).length === 1
         children.filter(c => c.type !== NodeTypes.COMMENT).length === 1
       ) {
       ) {
         patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT
         patchFlag |= PatchFlags.DEV_ROOT_FRAGMENT
-        patchFlagText += `, ${PatchFlagNames[PatchFlags.DEV_ROOT_FRAGMENT]}`
       }
       }
 
 
       return createVNodeCall(
       return createVNodeCall(