PropertyName kind can conflict with value #12

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

Comments

Projects
None yet
2 participants
@michaelficarra
Member

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

This comment has been minimized.

Show comment
Hide comment
@ikarienator

ikarienator Jan 17, 2015

Member

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

Member

ikarienator commented Jan 17, 2015

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

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 17, 2015

Member

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

Member

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

This comment has been minimized.

Show comment
Hide comment
@ikarienator

ikarienator Jan 17, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 18, 2015

Member

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

Member

michaelficarra commented Jan 18, 2015

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

@ikarienator

This comment has been minimized.

Show comment
Hide comment
@ikarienator

ikarienator Jan 18, 2015

Member

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

Member

ikarienator commented Jan 18, 2015

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

@michaelficarra

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 18, 2015

Member

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.

Member

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

This comment has been minimized.

Show comment
Hide comment
@michaelficarra

michaelficarra Jan 19, 2015

Member

Fixes on es6 branch by removing StaticPropertyName::kind.

Member

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