]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
refactor: memoIndex -> cacheIndex
authorEvan You <evan@vuejs.org>
Sat, 13 Jul 2024 13:05:06 +0000 (21:05 +0800)
committerEvan You <evan@vuejs.org>
Sat, 13 Jul 2024 13:05:06 +0000 (21:05 +0800)
packages/runtime-core/src/helpers/withMemo.ts
packages/runtime-core/src/renderer.ts
packages/runtime-core/src/vnode.ts

index 72ef814eefa9cca6382123edb8cc5d844271cefb..708726e89c97de59e88d573a2a5c945c448963bc 100644 (file)
@@ -15,7 +15,7 @@ export function withMemo(
 
   // shallow clone
   ret.memo = memo.slice()
-  ret.memoIndex = index
+  ret.cacheIndex = index
 
   return (cache[index] = ret)
 }
index 3f4a6f4a26554dd88856c9f26a5c71bffc0ac0ad..3f496cd8dd6d2d66c9162f8b4fa8bcc62d6dfac5 100644 (file)
@@ -2109,7 +2109,7 @@ function baseCreateRenderer(
       shapeFlag,
       patchFlag,
       dirs,
-      memoIndex,
+      cacheIndex,
     } = vnode
 
     if (patchFlag === PatchFlags.BAIL) {
@@ -2122,8 +2122,8 @@ function baseCreateRenderer(
     }
 
     // #6593 should clean memo cache when unmount
-    if (memoIndex != null) {
-      parentComponent!.renderCache[memoIndex] = undefined
+    if (cacheIndex != null) {
+      parentComponent!.renderCache[cacheIndex] = undefined
     }
 
     if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) {
index 626b288937d795d1a4184db3665f9a2780797d8e..d05d7744fad2fa561e07f96cf0a491fcc6294838 100644 (file)
@@ -243,7 +243,7 @@ export interface VNode<
   /**
    * @internal index for cleaning v-memo cache
    */
-  memoIndex?: number
+  cacheIndex?: number
   /**
    * @internal __COMPAT__ only
    */