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

PropertyName kind can conflict with value #12

Closed
michaelficarra opened this issue Jan 6, 2015 · 7 comments
Closed

PropertyName kind can conflict with value #12

michaelficarra opened this issue Jan 6, 2015 · 7 comments
Labels
Milestone

Comments

@michaelficarra
Copy link
Member

@michaelficarra michaelficarra commented Jan 6, 2015

For instance, a PropertyName with kind of "number" can have a non-numeric value, and a PropertyName with a kind of "identifier" can have a non-IdentifierName value. Is there a better way we can represent this?

@ikarienator
Copy link
Member

@ikarienator ikarienator commented Jan 17, 2015

In the java version, we used constructor overloading to restrict these problems.

@michaelficarra
Copy link
Member Author

@michaelficarra michaelficarra commented Jan 17, 2015

I believe we should just remove kind altogether. It was only there as a holdover from SpiderMonkey that preserved concrete syntax info.

@ikarienator
Copy link
Member

@ikarienator ikarienator commented Jan 17, 2015

I agree. But a drawback of that will be when we codegen a certain PropertyName, we always have to test which kind of it we want to generate.

@michaelficarra
Copy link
Member Author

@michaelficarra michaelficarra commented Jan 18, 2015

You can always safely quote it if you want. No test needed.

@ikarienator
Copy link
Member

@ikarienator ikarienator commented Jan 18, 2015

That'll end up to be a slightly longer code.

@michaelficarra
Copy link
Member Author

@michaelficarra michaelficarra commented Jan 18, 2015

I didn't say you had to do it, just that you could do it without testing for IdentifierName/numeric value by always quoting it.

@michaelficarra
Copy link
Member Author

@michaelficarra michaelficarra commented Jan 19, 2015

Fixes on es6 branch by removing StaticPropertyName::kind.

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.