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

Handle computed properties correctly and do not fail generation #340

Merged
merged 3 commits into from Apr 17, 2019

Conversation

danez
Copy link
Collaborator

@danez danez commented Apr 11, 2019

Fixes #317

This ignores complex computed properties.
Non complex ones (identifiers, literals) are prefixed with @computed# and otherwise handled like normal.

@danez danez added the bug label Apr 11, 2019
@danez danez force-pushed the handle-computed-properties branch from 1c14347 to a2ac022 Compare April 11, 2019 22:33
@fkling
Copy link
Member

fkling commented Apr 12, 2019

I didn't look at all the code, so maybe you already considered this: Should we try to resolve identifiers to their values and use that instead if it is a string or number?

@danez
Copy link
Collaborator Author

danez commented Apr 12, 2019

That's a good idea, will add this. String and number literals I can also use directly no need to prefix them.

{ ["name"]: x } // Should be "name" not "@computed#name"

@danez danez force-pushed the handle-computed-properties branch from 3cabee8 to f24e282 Compare April 12, 2019 19:30
@danez danez force-pushed the handle-computed-properties branch from f24e282 to d549790 Compare April 17, 2019 20:22
@danez danez merged commit ff33fc8 into master Apr 17, 2019
@danez danez deleted the handle-computed-properties branch April 17, 2019 20:59
@rotawebmail
Copy link

dynamic context type names fail the whole file

static contextTypes = {
[DYNAMIC_NAME]: ...
}
TypeError: Property name must be an Identifier or a Literal

why fail the entire file?
how to fix the problem?

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

Successfully merging this pull request may close these issues.

dynamic context type names fail the whole file
3 participants