Skip to content

Commit

Permalink
fix(runtime-core): ensure renderCache always exists
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Feb 18, 2020
1 parent 028f748 commit 8383e54
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion packages/runtime-core/src/componentProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8383e54

Please sign in to comment.