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

Editorial: More consistent wording for the %DateTimeFormat%.[[LocaleData]] requirements #360

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@Ms2ger
Copy link
Contributor

commented Jul 4, 2019

No description provided.

@leobalter
Copy link
Member

left a comment

Most of the changes LGTM, but I'm not sure if we should preserve the wording where the fields - [[hourCycle]] and [[formats]] - are required for [[LocaleData]].[[<_locale_>]].

cc @sffc @spectranaut, WDYT?

@sffc

This comment has been minimized.

Copy link
Collaborator

commented Jul 5, 2019

Old wording:

[[LocaleData]].[[<locale>]] must have an [[hourCycle]] field with a String value equal to "h11", "h12", "h23", or "h24" for all locale values locale.

New wording:

[[LocaleData]].[[<locale>]].[[hourCycle]] must be a String value equal to "h11", "h12", "h23", or "h24".

That is, the old wording is "X must have Y field which is Z", whereas the new wording is "X[Y] must be Z". Does the new wording imply that X[Y] exists? Are there examples elsewhere in ECMA 262 or 402?

@leobalter

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

@sffc It seems we've got the same sentiment. AFAIK, both specs are pretty explicit when a field is required.

We can ping @ljharb and @zenparsing to weight in here. hHopefully, it may not take a long time from them.

@ljharb

This comment has been minimized.

Copy link
Member

commented Jul 5, 2019

The dot notation implicitly yields undefined, i believe, if the LHS of the dot doesn’t have the field.

</p>

<ul>
<li>
The list that is the value of the `"nu"` field of any locale field of [[LocaleData]] must not include the values `"native"`, `"traditio"`, or `"finance"`.
[[LocaleData]].[[&lt;_locale_&gt;]].[[nu]] must be a list that does not include the values `"native"`, `"traditio"`, or `"finance"`.

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 5, 2019

Member
Suggested change
[[LocaleData]].[[&lt;_locale_&gt;]].[[nu]] must be a list that does not include the values `"native"`, `"traditio"`, or `"finance"`.
[[LocaleData]].[[&lt;_locale_&gt;]].[[nu]] must be a List that does not include the values `"native"`, `"traditio"`, or `"finance"`.

should this really be “traditio” or is it meant to be “traditional” or similar? Right now it looks like a typo/truncation.

</li>
<li>
[[LocaleData]][locale] must have a formats field for all locale values. The value of this field must be a list of records, each of which has a subset of the fields shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, where each field must have one of the values specified for the field in <emu-xref href="#table-datetimeformat-components"></emu-xref>. Multiple records in a list may use the same subset of the fields as long as they have different values for the fields. The following subsets must be available for each locale:
[[LocaleData]].[[&lt;_locale_&gt;]].[[formats]] must be a list of records, each of which has a subset of the fields shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, where each field must have one of the values specified for the field in <emu-xref href="#table-datetimeformat-components"></emu-xref>. Multiple records in a list may use the same subset of the fields as long as they have different values for the fields. The following subsets must be available for each locale:

This comment has been minimized.

Copy link
@ljharb

ljharb Jul 5, 2019

Member
Suggested change
[[LocaleData]].[[&lt;_locale_&gt;]].[[formats]] must be a list of records, each of which has a subset of the fields shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, where each field must have one of the values specified for the field in <emu-xref href="#table-datetimeformat-components"></emu-xref>. Multiple records in a list may use the same subset of the fields as long as they have different values for the fields. The following subsets must be available for each locale:
[[LocaleData]].[[&lt;_locale_&gt;]].[[formats]] must be a List of records, each of which has a subset of the fields shown in <emu-xref href="#table-datetimeformat-components"></emu-xref>, where each field must have one of the values specified for the field in <emu-xref href="#table-datetimeformat-components"></emu-xref>. Multiple records in a List may use the same subset of the fields as long as they have different values for the fields. The following subsets must be available for each locale:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.