fix(compiler): cache handlers should be per-instance, fix hoist w/ cached handlers

This commit is contained in:
Evan You
2019-10-20 17:00:11 -04:00
parent 39157f7671
commit 869ae19c41
9 changed files with 63 additions and 59 deletions

View File

@@ -219,12 +219,7 @@ function createTransformContext(
)
},
cache(exp) {
if (cacheHandlers) {
context.cached++
return createCacheExpression(context.cached, exp)
} else {
return exp
}
return cacheHandlers ? createCacheExpression(++context.cached, exp) : exp
}
}