-
Notifications
You must be signed in to change notification settings - Fork 108
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
AvailableCanonicalTimeZones is using a case-sensitive sort on case-insensitive data #790
Comments
@anba - because this normative change would only affect Firefox, do you have an opinion about whether this change would be a good idea or not? |
I don't think it's necessary to change this. IIRC we only wanted this to be sorted to ensure the output is more deterministic. (Deterministic insofar as that consecutive calls to |
@justingrant - what do you think? Move forward with this one, or close it? |
I still think it makes sense to be consistently case-insensitive for both sorting and comparison of identifiers. Seems weird to be sensitive for one but not for the other. I admittedly don't feel that strongly though. @gibson042 @sffc what do y'all think? |
I also lack strong feelings here, and since we currently have alignment between spec and implementation, my inclination is to leave the situation as-is. |
The spec currently says:
We stated previously that we could choose a different ordering based on use case but that we would use the I've personally had the position for a while that the bar for not using So my position is that we should keep the current spec and document in the style guide our norms for sorting return values. |
OK, works for me. Sounds like we'll leave the current behavior as-is. Should I leave this open to remind folks to make the style-guide changes? I also filed an MDN PR to warn users that time zones might be sorted unexpectedly: mdn/content#27890. |
* Clarify sorting for time zone IDs See tc39/ecma402#790 * Apply @Josh-Cena suggestion Co-authored-by: Joshua Chen <[email protected]> --------- Co-authored-by: Joshua Chen <[email protected]>
Style guide updated by #831 |
The underlying problem should no longer occur because PST8PDT is now removed from the list of canonical time zones in IANA and CLDR. I still think it would be sensible to use a case-insensitive sort instead of lexicographic for case-insensitive string data, but perhaps it's OK to wait to have that argument until there's a time that it will actually matter for observable results. |
I share that preference, and once removal of PST8PDT has fully propagated, we'll be in a position where the change from case-sensitive sorting to case-insensitive is unobservable, at which point I would feel comfortable making it. My primary motivation above for leaving things alone was avoiding visible churn, which will soon be a non-issue thanks to your efforts. |
reopening based on @gibson042 and @justingrant comments, tagging as blocked until such time as PST8PDT removal propagates |
Cool. If we make this change, then we should also amend the style guidelines too. |
AvailableCanonicalTimeZones uses a case-sensitive sort on a list of IANA Time Zone Database identifiers. These identifiers are case-insensitive, so shouldn't the sort also be case-insensitive?
Thankfully there's only one IANA canonical time zone that is impacted by this: PST8PDT. This time zone is currently sorted before
Pacific/*
zones, but if it had been insensitively sorted then it'd be near the end of the list. Note that only Firefox includes the PST8PDT zone, while other implementations exclude this zone, so changing this behavior would have no impact on non-FF implementations.The text was updated successfully, but these errors were encountered: