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

[Compiler] Methods in object literals #1373

Closed
jods4 opened this issue Jun 15, 2020 · 1 comment · Fixed by #1375
Closed

[Compiler] Methods in object literals #1373

jods4 opened this issue Jun 15, 2020 · 1 comment · Fixed by #1375

Comments

@jods4
Copy link
Contributor

jods4 commented Jun 15, 2020

Version

3.0.0-beta.15

Reproduction link

https://vue-next-template-explorer.netlify.app/#%7B%22src%22%3A%22%3Cdiv%20v-x%3D%5C%22%7B%20a%3A%201%2C%20b()%20%7B%20%7D%7D%5C%22%3E%3C%2Fdiv%3E%22%2C%22options%22%3A%7B%22mode%22%3A%22module%22%2C%22prefixIdentifiers%22%3Afalse%2C%22optimizeBindings%22%3Afalse%2C%22hoistStatic%22%3Afalse%2C%22cacheHandlers%22%3Afalse%2C%22scopeId%22%3Anull%7D%7D

Steps to reproduce

The compiler produces invalid content if you create an object literal with the method shorthand syntax, such as this:

<div v-x="{ a: 1, b() { hello() } }"></div>

What is expected?

v-x compiles to the expression:
{ a: 1, b() { _ctx.hello() } }

What is actually happening?

Compiles to the following, which is invalid:
{ a: 1, _ctx.b() { _ctx.hello() } }

@jods4
Copy link
Contributor Author

jods4 commented Jun 15, 2020

Wow less than 30 min. from open issue to merged fix. You're amazing guys! 🥇

@github-actions github-actions bot locked and limited conversation to collaborators Nov 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant