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

Computed keys #21

Open
Naddiseo opened this issue Jun 11, 2015 · 1 comment
Open

Computed keys #21

Naddiseo opened this issue Jun 11, 2015 · 1 comment

Comments

@Naddiseo
Copy link
Collaborator

TODO: Does our syntax cover computed keys?

let o = {
    [ key ] TypeHint : thing, // like this?
};
@Naddiseo
Copy link
Collaborator Author

Verified, it does:
PropertyDefinition : PropertyName TypeHint : AssignmentExpression
PropertyName expands to
PropertyDefinition : ComputedPropertyName TypeHint : AssignmentExpression
ComputedPropertyName expands to
PropertyDefinition : [ AssignmentExpression ] TypeHint : AssignmentExpression

TODO: Does the key need hinting? I think typescript allows hint inside the key.

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

2 participants