refactor(compiler): provide _ctx and _cache via arguments

This commit is contained in:
Evan You
2020-02-10 17:29:12 -05:00
parent ade07c64a1
commit 47e984d31f
21 changed files with 129 additions and 188 deletions

View File

@@ -47,7 +47,8 @@ export function renderComponentRoot(
slots,
attrs,
vnodeHooks,
emit
emit,
renderCache
} = instance
let result
@@ -57,7 +58,9 @@ export function renderComponentRoot(
}
try {
if (vnode.shapeFlag & ShapeFlags.STATEFUL_COMPONENT) {
result = normalizeVNode(instance.render!.call(withProxy || proxy))
result = normalizeVNode(
instance.render!.call(withProxy || proxy, proxy, renderCache)
)
} else {
// functional
const render = Component as FunctionalComponent