Skip to content

Commit 5fbd1f4

Browse files
committed
fix(compiler-core/v-on): only cache empty handler when the option is used
fix #1716 The original idea is that the empty handler can be cached in all cases, but this contradicts with the assumption that `hasCachedProps` check in the static hoist transform can simply return `false` in the browser build.
1 parent c930f2e commit 5fbd1f4

File tree

1 file changed

+1
-1
lines changed
  • packages/compiler-core/src/transforms

1 file changed

+1
-1
lines changed

packages/compiler-core/src/transforms/vOn.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const transformOn: DirectiveTransform = (
6868
if (exp && !exp.content.trim()) {
6969
exp = undefined
7070
}
71-
let isCacheable: boolean = !exp
71+
let isCacheable: boolean = context.cacheHandlers && !exp
7272
if (exp) {
7373
const isMemberExp = isMemberExpression(exp.content)
7474
const isInlineStatement = !(isMemberExp || fnExpRE.test(exp.content))

0 commit comments

Comments
 (0)