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: crashes when v-on expression is not a function (#2605) #2632

Closed
wants to merge 1 commit into from

Conversation

luwuer
Copy link
Contributor

@luwuer luwuer commented Nov 18, 2020

Close #2605

Assert if expression is a function by wraping it into a IIFE when the expression is a Instance member, if not warning and return NOOP.

Which expression are instance members:

  • @blur="test"
  • @blur="funs.test"

I am not sure that this PR is the best solution.

@luwuer
Copy link
Contributor Author

luwuer commented Nov 18, 2020

I thought about this PR when I was having dinner, i find that this is not a good solution because of below:

  1. Increased pack(compiled) size, lots of redundant code.
  2. No consistent experience when expression is not instance member, such as inline or function.
    • @blur="test(123, $event)"
    • @blur="() => { test() }"

I am confused, can you give me some suggestions for better ways? @yyx990803

@yyx990803
Copy link
Member

Thanks for the PR, but the fix can be simpler - see e4f09c1

@yyx990803 yyx990803 closed this Nov 30, 2020
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.

Null event crashes when called
2 participants