]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor(compile-vapor): remove unused ifBranchCount and ifBranch properties (#14339)
authoredison <daiwei521@126.com>
Tue, 20 Jan 2026 03:06:05 +0000 (11:06 +0800)
committerGitHub <noreply@github.com>
Tue, 20 Jan 2026 03:06:05 +0000 (11:06 +0800)
packages/compiler-vapor/src/generators/template.ts
packages/compiler-vapor/src/ir/index.ts
packages/compiler-vapor/src/transforms/vIf.ts

index e913b7f2795b1762e7b9dd304b426a6a22f93628..698daf1df9d9571a81d637a394d0b81db9a0f793 100644 (file)
@@ -71,7 +71,6 @@ export function genChildren(
 
   let offset = 0
   let prev: [variable: string, elementIndex: number] | undefined
-  let ifBranchCount = 0
   let prependCount = 0
 
   for (const [index, child] of children.entries()) {
@@ -83,8 +82,6 @@ export function genChildren(
     }
     if (child.flags & DynamicFlag.NON_TEMPLATE) {
       offset--
-    } else if (child.ifBranch) {
-      ifBranchCount++
     }
 
     const id =
@@ -100,7 +97,7 @@ export function genChildren(
     }
 
     const elementIndex = index + offset
-    const logicalIndex = elementIndex - ifBranchCount + prependCount
+    const logicalIndex = elementIndex + prependCount
     // p for "placeholder" variables that are meant for possible reuse by
     // other access paths
     const variable =
index 24a554a8dc987ff631053bd936934e4c906e2c08..520143059a60540840544d9609ff5d1a8955b10e 100644 (file)
@@ -268,7 +268,6 @@ export interface IRDynamicInfo {
   template?: number
   hasDynamicChild?: boolean
   operation?: OperationNode
-  ifBranch?: boolean
 }
 
 export interface IREffect {
index fba8a018d2a95848433db08e4bac6b44ed86e3b8..ea118c67c463cc70ccb45336ab49ed93d69b4861 100644 (file)
@@ -59,7 +59,6 @@ export function processIf(
   } else {
     // check the adjacent v-if
     const siblingIf = getSiblingIf(context, true)
-    context.dynamic.ifBranch = true
 
     const siblings = context.parent && context.parent.dynamic.children
     let lastIfNode