From 8383e5450e4f9679ac8a284f1c3960e3ee5b5211 Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 18 Feb 2020 14:43:04 -0500 Subject: [PATCH] fix(runtime-core): ensure renderCache always exists --- packages/runtime-core/src/component.ts | 4 ++-- packages/runtime-core/src/componentProxy.ts | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/runtime-core/src/component.ts b/packages/runtime-core/src/component.ts index dc7d3a24c56..cf2b2dc057a 100644 --- a/packages/runtime-core/src/component.ts +++ b/packages/runtime-core/src/component.ts @@ -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 @@ -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, diff --git a/packages/runtime-core/src/componentProxy.ts b/packages/runtime-core/src/componentProxy.ts index b2ff4baada1..4582496e442 100644 --- a/packages/runtime-core/src/componentProxy.ts +++ b/packages/runtime-core/src/componentProxy.ts @@ -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,