-
Notifications
You must be signed in to change notification settings - Fork 107
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: Reorder NF resolved option "roundingPriority" #768
Normative: Reorder NF resolved option "roundingPriority" #768
Conversation
1. If _nf_.[[RoundingType]] is ~morePrecision~, then | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"morePrecision"*). | ||
1. Else if _nf_.[[RoundingType]] is ~lessPrecision~, then | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"lessPrecision"*). | ||
1. Else, | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"auto"*). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this seems normative (on the editorial commit) - does adding it to the table below cause it to be implicitly set on options
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There is a normative change, which is that the order in which the append order for the options is changing slightly: previously roundingPriority was at the end, but now it is second from the end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the case, the commit is mislabeled; it'd help my review, at least, to split up the editorial and normative parts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The editorial and normative parts are separated, as explained in the PR description.
1ee3bee39e4b2bc21cb9105b7fba2c0c7cef4627
is editorial, moving the infallible computation of rounding priority fromNumberFormat.prototype.resolvedOptions
to theIntl.NumberFormat
constructor and updating theresolvedOptions
algorithm to add a "roundingPriority" property from the table in step 5 rather than from special steps following table row iteration (but still adding "roundingPriority" as the observably last property).0d936078aaf3d83b114ae092f4ac80e7bbfbcf85
is normative, reordering table rows such that "roundingPriority" will be grouped with the other "rounding…" properties and observably precede "trailingZeroDisplay".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is on the editorial commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So what part of «Editorial: Move computation of NF resolved option "roundingPriority" to initialization» is mislabeled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gibson042 that was my question. I only looked at the editorial commit, and I saw the line I'm commenting on here. @sffc said it's normative. Your comment implies that it's not normative ("but still"), which was what i'd been asking about.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears to me that the editorial commit is editorial, and the normative commit is normative
TG2 discussion (was on the problem, before seeing the concrete PR): https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-04-06.md#nfv3-resolvedoptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; let's seek approval from the rest of the group.
1. If _nf_.[[RoundingType]] is ~morePrecision~, then | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"morePrecision"*). | ||
1. Else if _nf_.[[RoundingType]] is ~lessPrecision~, then | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"lessPrecision"*). | ||
1. Else, | ||
1. Perform ! CreateDataPropertyOrThrow(_options_, *"roundingPriority"*, *"auto"*). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There is a normative change, which is that the order in which the append order for the options is changing slightly: previously roundingPriority was at the end, but now it is second from the end.
TG2 discussion again: https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-06-29.md#normative-reorder-nf-resolved-option-roundingpriority Still needs tests; otherwise has TG2 approval. |
could someone explain to me why do we bother to make this PR to change the order of "roundingPriority" in the resolvedOptions() to be placed before "trailingZeroDisplay" but in the mean time KEEP the order of "roundingIncrement" after "roundingMode" and not change it to be placed before "roundingMode"??? |
@sffc provided a partial answer at tc39/proposal-intl-numberformat-v3#122 (comment) . But the whole thing is clearly a mess anyway, and at this point I'd be equally happy to rearrange "roundingIncrement" as well (or to keep "roudingPriority" at the end and reduce this PR to the editorial commit that just fixes the |
This PR puts the three rounding modifiers (roundingMode, roundingIncrement, and roundingPriority) next to each other. Why is there desire to change the order amongst those three? At least they are adjacent now. |
Here is the READING order of these options now as July 12, 2023)
It seems there are no dependency between these four option readings in the current shape of ECMA402, right? After this PR merged, the order in the resolvedOptions between these four will be
so... the new order in both the option reading AND the resolvedOptions() so... if the order is really matter and require a PR to change it, would it be better to or at least I am not going to block you from merging this PR at this point since it passed TC39 consensus this week already. But I just have hard time to understand the need to change from what we had to this "half baked" state. |
v8 bug tracking https://bugs.chromium.org/p/v8/issues/detail?id=14169 @gibson042 |
Let's take this to a follow-on issue. I'll merge this. |
Could you merge this ASAP? My landing of https://chromium-review.googlesource.com/c/v8/v8/+/4679292 is blocked by the merging of this PR. |
@FrankYFTang sorry I missed this, done. |
Ref #768 * Read "roundingIncrement", "roundingMode", "roundingPriority", "trailingZeroDisplay" in alphabetic order. * Output "pluralCategories", "roundingIncrement", "roundingMode", "roundingPriority", "trailingZeroDisplay" in alphabetic order.
Ref tc39#768 * Read "roundingIncrement", "roundingMode", "roundingPriority", "trailingZeroDisplay" in alphabetic order. * Output "pluralCategories", "roundingIncrement", "roundingMode", "roundingPriority", "trailingZeroDisplay" in alphabetic order.
The second commit is a normative reordering of property sequence; the first commit is a supporting editorial change that should land in some form even if the normative change is rejected.