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

Put rounding-related resolvedOptions properties in alphabetical order #33340

Merged

Conversation

ben-allen
Copy link
Contributor

Description

This is a very small change -- it just puts the rounding-related properties of the object returned by Intl.NumberFormat.resolvedOptions() and Intl.PluralRules.resolvedOptions() in alphabetical order.

Motivation

This makes the text marginally more readable, and has the advantage of reflecting the output order as currently defined in the spec.

Additional details

See tc39/ecma402#811

…mat` and

`Intl.PluralRules` in alphabetical order to match correct output
@ben-allen ben-allen requested a review from a team as a code owner April 30, 2024 20:15
@ben-allen ben-allen requested review from Josh-Cena and removed request for a team April 30, 2024 20:15
@github-actions github-actions bot added Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed labels Apr 30, 2024
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

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

We do align with the spec on property order. I was about to say that but I realized the spec changed too! Thanks!

@Josh-Cena Josh-Cena merged commit a19586c into mdn:main Apr 30, 2024
7 checks passed
@ben-allen
Copy link
Contributor Author

@Josh-Cena The order of properties in the objects returned by resolvedOptions for many of the Intl objects doesn't match the spec order. See, for example, the spec for Intl.ListFormat.prototype.resolvedOptions(), which has "type" before "style" in the associated table, whereas the MDN page has style before type.

Would it be worthwhile to go through and put these properties in spec order across MDN's Intl documentation, aside from properties where putting them in spec order would be confusing (i,e. ones where there's special rules, as with the properties in NumberFormat related to number of fractional digits and number of significant digits?

I'm particularly noticing (and particularly want to change) resolvedOptions() documentation where locale isn't the first property listed, for example on the page for Intl.NumberFormat.prototype.resolvedOptions().

@Josh-Cena
Copy link
Member

So, I thought I already did that long ago, but I just went to check and saw that it's still stashed in my local repo.

Could you wait a few weeks? I'll try to finish my existing work on unifying resolvedOptions format. If I couldn't get it done then, you could go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:JS JavaScript docs size/s [PR only] 6-50 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants