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

Normative: Stage4 PR for proposal-intl-enumeration #716

Merged
merged 10 commits into from
Apr 3, 2023

Conversation

FrankYFTang
Copy link
Contributor

Plan to suggest moving to Stage 4 in Nov 2022
https://github.com/tc39/proposal-intl-enumeration

It is already implemented in Chrome m99, Safari 15.4 and Firefox 93.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#browser_compatibility

1. Else if _key_ is *"unit"*, then
1. Let _list_ be AvailableCanonicalUnits( ).
1. Else,
1. Throw a *RangeError* exception.
Copy link
Member

Choose a reason for hiding this comment

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

a RangeError, from an unknown key? i'd expect a TypeError here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is that? the type of the key is String, we also throw RangeError in https://tc39.es/ecma402/#sec-getoption right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

other places in ECMA402 we also throw RangeError
https://tc39.es/ecma402/#sec-canonicalcodefordisplaynames
https://tc39.es/ecma402/#sec-canonicalizelocalelist
"a. If collation does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception."
in https://tc39.es/ecma402/#sec-initializecollator
"a. If calendar does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
b. If the result of ! IsValidTimeZoneName(timeZone) is false, then
"
in https://tc39.es/ecma402/#sec-initializedatetimeformat

"a. If calendar does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
a. If collation does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
a. If numberingSystem does not match the Unicode Locale Identifier type nonterminal, throw a RangeError exception.
"
in https://tc39.es/ecma402/#sec-Intl.Locale
also
https://tc39.es/ecma402/#sec-apply-options-to-tag
https://tc39.es/ecma402/#sec-initializenumberformat

"

Copy link
Member

Choose a reason for hiding this comment

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

That seems very strange - RangeErrors are for when something is out of a range - enums aren't a "range", conceptually or otherwise.

Copy link
Contributor

Choose a reason for hiding this comment

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

RangeError (emphasis mine)

Indicates a value that is not in the set or range of allowable values.

It's also used this way in ECMA-262:

Copy link
Member

Choose a reason for hiding this comment

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

fromCodePoint is an actual ascii range; the AOs are ranges as well; but you’re right that normalize is a good analog. It still seems super weird to me, since an enum simply isn’t a range of any kind.

@sffc
Copy link
Contributor

sffc commented Jan 12, 2023

Ping to the editors to review this PR.

Copy link
Contributor

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

Looks good after resolving some editorial nits, mostly relating to #735 or #736 or recent ECMA-262 changes.

FrankYFTang and others added 5 commits January 30, 2023 09:22
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
@FrankYFTang
Copy link
Contributor Author

PTAL and merge if ready?

Copy link
Contributor

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

A couple more phrase replacements.

FrankYFTang and others added 2 commits February 9, 2023 10:43
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
@FrankYFTang
Copy link
Contributor Author

PTAL and merge

Copy link
Contributor

@gibson042 gibson042 left a comment

Choose a reason for hiding this comment

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

This still looks good to me, modulo the linting fix. @ryzokuken, could you look it over as well?


<emu-clause id="sec-availablecanonicaltimezones" type="implementation-defined abstract operation">
<h1>
AvailableCanonicalTimeZones (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
AvailableCanonicalTimeZones (
AvailableCanonicalTimeZoneIdentifiers (

With Temporal approaching Stage 4, "TimeZone" will soon be ambiguous: does it mean string identifier or a Temporal.TimeZone object?

Therefore @gibson042 and I are planning to rename all identifier-related AOs with an "Identifier" suffix. Given that this is a new AO, should we rename it here too to save churn later?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about do those after merge this PR. Temporal is not going to be ES2023 but this will be

Copy link
Contributor

Choose a reason for hiding this comment

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

OK, that's fine with me. Not a big deal either way.

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Copy link
Member

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

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

LGTM overall, I am happy with throwing a RangeError here, since it describes the exact nature of the failure better than a TypeError would, as the latter may result in user confusion.

@ryzokuken ryzokuken merged commit 81856b3 into tc39:master Apr 3, 2023
ben-allen pushed a commit to ben-allen/ecma402 that referenced this pull request Apr 10, 2023
* Normative: Stage4 PR for proposal-intl-enumeration

Plan to suggest moving to Stage 4 in Nov 2022
https://github.com/tc39/proposal-intl-enumeration

It is already implemented in Chrome m99, Safari 15.4 and Firefox 93.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#browser_compatibility

* sync w/ intl-enumeration pull/43

tc39/proposal-intl-enumeration#43

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

---------

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
ben-allen pushed a commit to ben-allen/ecma402 that referenced this pull request Apr 11, 2023
* Normative: Stage4 PR for proposal-intl-enumeration

Plan to suggest moving to Stage 4 in Nov 2022
https://github.com/tc39/proposal-intl-enumeration

It is already implemented in Chrome m99, Safari 15.4 and Firefox 93.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/supportedValuesOf#browser_compatibility

* sync w/ intl-enumeration pull/43

tc39/proposal-intl-enumeration#43

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

* Update spec/locales-currencies-tz.html

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>

---------

Co-authored-by: Richard Gibson <richard.gibson@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants