ecma402
ecma402 copied to clipboard
Consistency for [[HourCycle]] from LocaleData
From https://tc39.github.io/ecma402/#sec-initializedatetimeformat
Is that lowercase dataLocalData.[[hourCycle]] intentional? It happens twice in the specs.
It sounds like a typo but I might be missing something from the LocaleData as in Let dataLocaleData be localeData.[[<dataLocale>]].
But also from DateTimeFormat Internal Slots we read [[LocaleData]][locale] must have a hourCycle field with a String value equal to "h11", "h12", "h23", or "h24" for all locale values.
First fix I can imagine is [[hourCycle]] becoming [[HourCycle]] with the Internal Slots section describing the hourCycle as a matching internal field.
I'm not sure if there's a problem here. Lowercase is used for record fields of the locale data, and uppercase is used for the internal slots of the formatter. If we switch to uppercase for the locale data, we might want to do that in a more broad way.
I guessed something like it but it feels odd accessing the record field of the locale data as if it were a internal slots, including the [[]] parts.
Maybe the consistency I desire should also consider the HourCycle is also declared with the brackets padding, e.g. here should probably say [[HourCycle]].
Maybe the alternative is adding some spec text saying the record fields of localeData are accessed like internal slots and might be represented as such with the brackets padding. Like in Intl.Collator's accessing sensitivity. This would be just a clarification without a change to any other part of the specs.
WDYT, @littledan?
The locale data used to be objects, and @anba refactored it to be records. Clarifying how this works sounds like a really good idea--I had trouble understanding it for a while when I was getting into these specs, personally. I don't have a great idea for how to explain things better, though.
cool, this also sounds like a good editorial exercise thing. I'll check with @spectranaut for some good insights for it.
If this needs to be discussed further on Friday, please move the corresponding Kanban card to the Discuss column.