From: edison Date: Tue, 20 Jan 2026 03:06:05 +0000 (+0800) Subject: refactor(compile-vapor): remove unused ifBranchCount and ifBranch properties (#14339) X-Git-Tag: v3.6.0-beta.4~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2e7cd2d47059a7ddd86a4b28aaa6bfb69418988;p=thirdparty%2Fvuejs%2Fcore.git refactor(compile-vapor): remove unused ifBranchCount and ifBranch properties (#14339) --- diff --git a/packages/compiler-vapor/src/generators/template.ts b/packages/compiler-vapor/src/generators/template.ts index e913b7f279..698daf1df9 100644 --- a/packages/compiler-vapor/src/generators/template.ts +++ b/packages/compiler-vapor/src/generators/template.ts @@ -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 = diff --git a/packages/compiler-vapor/src/ir/index.ts b/packages/compiler-vapor/src/ir/index.ts index 24a554a8dc..520143059a 100644 --- a/packages/compiler-vapor/src/ir/index.ts +++ b/packages/compiler-vapor/src/ir/index.ts @@ -268,7 +268,6 @@ export interface IRDynamicInfo { template?: number hasDynamicChild?: boolean operation?: OperationNode - ifBranch?: boolean } export interface IREffect { diff --git a/packages/compiler-vapor/src/transforms/vIf.ts b/packages/compiler-vapor/src/transforms/vIf.ts index fba8a018d2..ea118c67c4 100644 --- a/packages/compiler-vapor/src/transforms/vIf.ts +++ b/packages/compiler-vapor/src/transforms/vIf.ts @@ -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