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

Decorating properties with computed names #63

Open
AndreSteenveld opened this issue Apr 5, 2017 · 1 comment
Open

Decorating properties with computed names #63

AndreSteenveld opened this issue Apr 5, 2017 · 1 comment

Comments

@AndreSteenveld
Copy link

Decorating class properties with computed names throws an error during compilation and class properties whose names are strings will generate code which will throw an error with the message: Decorating class property failed. Please ensure that transform-class-properties is enabled..

Google-ing for that error turned up issue #13 and looking through the other issues #59 seems to actually be the same problem.

I'd like to add the reproduction cases from the attached gist to the unit test but I am not confident enough I'll be able to actually solve this issue by myself. :)

See this gist for all the files: Decorating properties with computed names

@kgram
Copy link

kgram commented Jun 15, 2017

I believe your decorator usage in the runtime-error example is wrong (as well as the compilation-error example, although it doesn't explain the compilation error). You invoke d, so your decorator function is actually undefined.

A weird case that does parse:

@d
async ['key']() {}

All these fail, though:

@d
['key']: () => {}
@d
['key']: async () => {}
@d
['key']() {}

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

No branches or pull requests

2 participants