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

Allow condition keys to be StringLiterals in addition to IdentifierNames #84

Merged
merged 1 commit into from
Jul 21, 2020

Conversation

dandclark
Copy link
Collaborator

Condition keys are currently limited to being IdentifierNames. This change additionally allows them to be string literals (' or ") , so that the condition entries list can be written a bit more like an object literal.

Numeric literals are still not permitted.

It's not yet certain that we want to go this route, so this won't be merged until we reach some conclusion regarding the discussion in #78.

Closes #78.

@dandclark dandclark requested a review from littledan July 17, 2020 00:05
@dandclark dandclark force-pushed the dandclark/let-condition-entries-be-strings branch from 9714a7c to c38a335 Compare July 17, 2020 00:09
Copy link
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very simple and clear spec text! Approving to land if we agree on this change, as you say.

Copy link
Member

@xtuc xtuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@michaelficarra
Copy link
Member

Just use LiteralPropertyName.

@dandclark
Copy link
Collaborator Author

Just use LiteralPropertyName.

LiteralPropertyName also includes NumericLiteral, and I don't think anyone's been advocating to allow those at this point (looking at #78).

@michaelficarra
Copy link
Member

I am advocating for it. I would expect any LiteralPropertyName to be allowed in that position.

@dandclark
Copy link
Collaborator Author

Oh, I misunderstood. Let's discuss in #78.

@xtuc xtuc force-pushed the dandclark/let-condition-entries-be-strings branch from c38a335 to cff6dd5 Compare July 21, 2020 21:41
@xtuc
Copy link
Member

xtuc commented Jul 21, 2020

As discussed during the July 2020 TC39 meeting, it seems that people are in favor of allowing quotes, merging this.

@xtuc xtuc merged commit 2d39dc7 into master Jul 21, 2020
@xtuc xtuc deleted the dandclark/let-condition-entries-be-strings branch July 21, 2020 21:48
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

Successfully merging this pull request may close these issues.

Should we allow string literal as key in condition entries?
4 participants