]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: isVNode -> isVOnce
authorEvan You <evan@vuejs.org>
Sat, 13 Jul 2024 13:07:45 +0000 (21:07 +0800)
committerEvan You <evan@vuejs.org>
Sat, 13 Jul 2024 13:07:45 +0000 (21:07 +0800)
packages/compiler-core/src/ast.ts
packages/compiler-core/src/codegen.ts

index 562e24e72e3746a32badedd4e833d4217fdc384a..bbbb7f8a19dbc7fd3ad49476f917d037280f2f46 100644 (file)
@@ -416,7 +416,7 @@ export interface CacheExpression extends Node {
   type: NodeTypes.JS_CACHE_EXPRESSION
   index: number
   value: JSChildNode
-  isVNode: boolean
+  isVOnce: boolean
 }
 
 export interface MemoExpression extends CallExpression {
@@ -771,13 +771,13 @@ export function createConditionalExpression(
 export function createCacheExpression(
   index: number,
   value: JSChildNode,
-  isVNode: boolean = false,
+  isVOnce: boolean = false,
 ): CacheExpression {
   return {
     type: NodeTypes.JS_CACHE_EXPRESSION,
     index,
     value,
-    isVNode,
+    isVOnce,
     loc: locStub,
   }
 }
index 4dd51133ce7129e821d9d9d0ff563d69501790cf..392896d60823228e3c444079eef163d58184f183 100644 (file)
@@ -1037,14 +1037,14 @@ function genConditionalExpression(
 function genCacheExpression(node: CacheExpression, context: CodegenContext) {
   const { push, helper, indent, deindent, newline } = context
   push(`_cache[${node.index}] || (`)
-  if (node.isVNode) {
+  if (node.isVOnce) {
     indent()
     push(`${helper(SET_BLOCK_TRACKING)}(-1),`)
     newline()
   }
   push(`_cache[${node.index}] = `)
   genNode(node.value, context)
-  if (node.isVNode) {
+  if (node.isVOnce) {
     push(`,`)
     newline()
     push(`${helper(SET_BLOCK_TRACKING)}(1),`)