-
Notifications
You must be signed in to change notification settings - Fork 105
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
Ensure data returned from Intl Enumeration is consistent with data supported by Intl objects #814
Comments
We just have to make sure we don't require to have data which isn't present. For example js> print(new Intl.NumberFormat("en", {style: "currency", currency: "ZZZ"}).format(1))
ZZZ 1.00 whereas js> print(new Intl.DisplayNames("en", {type: "currency", fallback: "none"}).of("ZZZ"))
undefined And some currencies are even only supported for certain locales: js> print(new Intl.DisplayNames("en", {type: "currency", fallback: "none"}).of("UYW"))
Uruguayan Nominal Wage Index Unit
js> print(new Intl.DisplayNames("de", {type: "currency", fallback: "none"}).of("UYW"))
undefined |
any suggestion of how to phrase that in the spec text? |
Maybe using a host hook as the source of truth for viable values for both enumeration and also other relevant APIs, and requiring the host hook always return the same values across calls? |
Any suggestion of how to add such mandate into the spec text? |
A normative note that says so, like https://tc39.es/ecma262/#sec-hostimportmoduledynamically has ("it must always do so for subsequent calls."). |
We can work on the editorial language here after it is merged into ECMA-402. |
For time zones, what you describe is not the current behavior. FWIW, I think that this is the right default behavior, because AFAICT the main use case for For calendars, a similar argument could be made for the deprecated We could extend |
FWIW, similar language is already part of https://tc39.es/proposal-temporal/#sup-availablenamedtimezoneidentifiers and https://tc39.es/proposal-temporal/#sup-availablenamedtimezoneidentifiers. |
(I remember discussing this before, but I can't find an issue for it)
We should make sure that the lists returned from Intl Enumeration is required by the spec to be the same as the lists of what Intl objects support. For example,
Intl.DateTimeFormat
should support the calendar systems returned byIntl.supportedValuesOf("calendar")
, no more, no less.The text was updated successfully, but these errors were encountered: