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

Svelte should throw a compile time error when illegal characters are used in computed names #1083

Closed
lnryan opened this issue Jan 7, 2018 · 3 comments

Comments

@lnryan
Copy link

lnryan commented Jan 7, 2018

Computed values are transformed into functions so random-api becomes random-api(){} which is not allowed.

        computed:{
            "random-api":(pw_min,pw_max,passwords)=>{
                return `apiurlsomethingsomething`
            }
        }

The compiler should suggest an alternative like random_api, which is admittedly uglier 🤷‍♀️, but completely valid, and not svelte's fault obvi

@Conduitry Conduitry changed the title Svelte should throw a compile time error when illegal characters are used in component names Svelte should throw a compile time error when illegal characters are used in computed names Jan 10, 2018
@eh-dub
Copy link
Contributor

eh-dub commented Jan 11, 2018

@arxpoetica, @Rich-Harris threw this issue my way on gitter this morning.
I understand the high-level problem and will muddle through the code to figure out how to go about implementing a fix.

@eh-dub
Copy link
Contributor

eh-dub commented Jan 12, 2018

Submitted #1099
I'm open to all questions and suggestions.

@Rich-Harris
Copy link
Member

Fix released in 1.52 — thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants