tc39 / proposal-import-attributes

Proposal for syntax to import ES modules with assertions
https://tc39.es/proposal-import-attributes/
Apache License 2.0
599 stars 26 forks source link

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

Closed dandclark closed 4 years ago

dandclark commented 4 years ago

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.

michaelficarra commented 4 years ago

Just use LiteralPropertyName.

dandclark commented 4 years ago

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 commented 4 years ago

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

dandclark commented 4 years ago

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

xtuc commented 4 years ago

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