]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(runtime-core): ensure renderCache always exists
authorEvan You <yyx990803@gmail.com>
Tue, 18 Feb 2020 19:43:04 +0000 (14:43 -0500)
committerEvan You <yyx990803@gmail.com>
Tue, 18 Feb 2020 19:43:12 +0000 (14:43 -0500)
packages/runtime-core/src/component.ts
packages/runtime-core/src/componentProxy.ts

index dc7d3a24c562a3cc8d0a01f045d0cfde13a8b262..cf2b2dc057aa35b544cd783a25226b11cd729772 100644 (file)
@@ -114,7 +114,7 @@ export interface ComponentInternalInstance {
   accessCache: Data | null
   // cache for render function values that rely on _ctx but won't need updates
   // after initialized (e.g. inline handlers)
-  renderCache: (Function | VNode)[] | null
+  renderCache: (Function | VNode)[]
 
   // assets for fast resolution
   components: Record<string, Component>
@@ -192,7 +192,7 @@ export function createComponentInstance(
     effects: null,
     provides: parent ? parent.provides : Object.create(appContext.provides),
     accessCache: null!,
-    renderCache: null,
+    renderCache: [],
 
     // setup context properties
     renderContext: EMPTY_OBJ,
index b2ff4baada17fe4c9e9e95ad611bdfa05e7fb21e..4582496e442fa041b6ec2f34546f67dc5506348e 100644 (file)
@@ -51,7 +51,6 @@ const publicPropertiesMap: Record<
 > = {
   $: i => i,
   $el: i => i.vnode.el,
-  $cache: i => i.renderCache || (i.renderCache = []),
   $data: i => i.data,
   $props: i => i.propsProxy,
   $attrs: i => i.attrs,