Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(compiler-core): warn for empty vOn expression + improve performan… #1719

Closed
wants to merge 2 commits into from

Conversation

underfin
Copy link
Member

…ce of detect cache props

fix #1716

if (exp && !exp.content.trim()) {
exp = undefined
}
if (!exp && !modifiers.length) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should be performed before setting empty exp to undefined because empty v-on with modifiers are allowed, e.g. @click.prevent

if (__BROWSER__) {
return false
}
if (!context.cacheHandlers) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This check should be performed in all cases because cacheHandlers is not the only mechanism that uses the cache, another example is v-once, and we may add more in the future.

@yyx990803
Copy link
Member

See 5fbd1f4

@yyx990803 yyx990803 closed this Jul 27, 2020
@underfin underfin deleted the fix-empty-von-exp branch July 28, 2020 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiler: v-on access _cache in hoisted element outside render function if handler is empty
3 participants