ecma402
ecma402 copied to clipboard
Editorial: Start all fields and slots with an uppercase code point
In order to align with 262 on this, we will have to refactor part of the spec due to the following:
As an extension to the Record Specification Type, the notation
"[[<name>]]"denotes a field whose name is given by the variable name, which must have a String value. For example, if a variable s has the value"a", then[[<s>]]denotes the field[[<a>]].For ECMAScript objects, this standard may use variable-named internal slots: The notation
"[[<name>]]"denotes an internal slot whose name is given by the variable name, which must have a String value. For example, if a variable s has the value"a", then[[<s>]]denotes the[[<a>]]internal slot.
This is very tricky, but worth the effort IMO. I might delay this work until after 3rd edition because formatToParts will change the way we transform the patterns for number and datetime format, which can facilitate this work.
/cc @littledan @bterlson
If it's a 'procedurally generated' name, then I don't think this rule needs to apply the same way. However, I like the way that formatToParts changes this.
yeah, I do have a local branch for this, but lets wait until after formatToParts() lands for 4th edition.
hopefully 5th edition.
These is related to #56 as well. We are almost there, and lowercase is only used in match resolvers and locale data records as far as I can tell. @anba, @littledan, do you guys think that this is realistic?
Not sure what you are asking. The change still seems like a good idea to me.
@leobalter @littledan I also wonder if we should keep with issue open. Now that I submitted https://github.com/tc39/ecma402/pull/401, all the remaining non-capitalized record fields are from constructing records from locale data (for example, in resolveLocale). Maybe it's best to simply allow non-capitalized field names in 402 because of this case.
@spectranaut I'm glad your patch landed. I agree it wouldn't make sense to capitalize a record field like [[nu]]. However, I don't understand why things like [[locale]], [[dataLocale]] and [[extension]] should be lower case. Was this left that way deliberately?
Related: #339
@gibson042 this still needs to happen, right?
I don't feel strongly about it. The lowercase field names don't bother me, especially those that directly correspond with the canonical form of BCP 47 language subtags or Unicode -u- extension keys in e.g. [[AvailableLocales]] and [[RelevantExtensionKeys]]. But I would like to uppercase [[locale]] and [[extension]] field names in locale records (probably renaming at least [[locale]] in the process), [[localeMatcher]]/[[dataLocale]]/etc. in ResolveLocale, and anything else that is not reflecting externally-defined names.
Happy to let the editors decide whether to either fix this issue or close this issue.