-
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: Fix order of rounding* option reads and resolvedOptions() #811
Conversation
The fix for the lint error is in #812 |
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 changes are the most important, thanks for the bugfixes. I don't feel strongly about the normative change, if you and other implementers all prefer alphabetical order, then let's do it.
Conclusion: RGN and FYT will work together on changes to the PR, which we will then bring to plenary. |
Ping @FrankYFTang @gibson042 |
1 similar comment
Ping @FrankYFTang @gibson042 |
Split the editorial fix from tc39#811 1. Add text to explain ComputedRoundingPriority in section "15.4 Properties of Intl.NumberFormat Instances" https://tc39.es/ecma402/#sec-properties-of-intl-numberformat-instances and "16.4 Properties of Intl.PluralRules Instances https://tc39.es/ecma402/#sec-properties-of-intl-pluralrules-instances 2. Add ComputedRoundingPriority to Intl.PluralRules https://tc39.es/ecma402/#sec-intl.pluralrules Without this, the spec is not implementable because InitializePluralRules call "SetNumberFormatDigitOptions(pluralRules, options, +0𝔽, 3𝔽, "standard")." and SetNumberFormatDigitOptions assume the intlObj has [[ComputedRoundingPriority]]
During the discussion of https://github.com/tc39/ecma402/blob/master/meetings/notes-2023-08-03.md#normative-fix-order-of-rounding-option-reads-and-resolvedoptions-811 RGN express the desire to split out the "editorial" part of the PR to another one. I split the item 1. and 2. into #829 now. Once we merge 829, I will rebase this PR on top of that and those editoral change should be removed from this PR. |
This PR are mostly Normative but have some editorial parts 1. Editorial: Add text to explain ComputedRoundingPriority in section "15.4 Properties of Intl.NumberFormat Instances" https://tc39.es/ecma402/#sec-properties-of-intl-numberformat-instances and "16.4 Properties of Intl.PluralRules Instances https://tc39.es/ecma402/#sec-properties-of-intl-pluralrules-instances 2. Editorial: Add ComputedRoundingPriority to Intl.PluralRules https://tc39.es/ecma402/#sec-intl.pluralrules Without this, the spec is not implementable because InitializePluralRules call "SetNumberFormatDigitOptions(pluralRules, options, +0𝔽, 3𝔽, "standard")." and SetNumberFormatDigitOptions assume the intlObj has `[[ComputedRoundingPriority]]` 3. Normative: Move the reading of "roundingPriority" from before reading "roundingIncrement" to after reading "roundingMode" so these three fields are read in alphabetic order. https://tc39.es/ecma402/#sec-setnfdigitoptions 4. Normative: Move the output order of "roundingIncrement" from after output "roundingMode" to before that so these two fields are read in alphabetic order in the resolvedOptions of both Intl.NumberFormat and Intl.PluralRules. https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions 5. Normative: Move the output of "roundingPriority" from after "trailingZeroDisplay" before that to sync w/ Intl.NumberFormat after PR768. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions 6. Normative: Move the output of "pluralCategories" from after "trailingZeroDisplay" to before "roundingIncrement" so these options will be in alphabetic order. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions
6f0db10
to
9b7711a
Compare
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 looks good modulo the algorithmic details; is there already a test262 PR?
PTAL |
v8 implementation https://chromium-review.googlesource.com/c/v8/v8/+/4855044 |
|
This PR reach consensus on 2023-09-26 meeting |
please merge |
@ben-allen @gibson042 Please merge. This has TC39 blessing last week. |
Fix order of rounding* option reads and resolvedOptions() of NumberFormat and PluralRules tc39/ecma402#811 Details: Change order of rounding* option reads and resolvedOptions() 1. Move the reading of "roundingPriority" from before reading "roundingIncrement" to after reading "roundingMode" so these three fields are read in alphabetic order. https://tc39.es/ecma402/#sec-setnfdigitoptions 2. Move the output order of "roundingIncrement" from after output "roundingMode" to before that so these two fields are read in alphabetic order in the resolvedOptions of both Intl.NumberFormat and Intl.PluralRules. https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions 3. Move the output of "roundingPriority" from after "trailingZeroDisplay" before that to sync w/ Intl.NumberFormat after PR768. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions 4. Move the output of "pluralCategories" from after "trailingZeroDisplay" to before "roundingIncrement" so these options will be in alphabetic order. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions Bug: v8:14308 Change-Id: I37168bf0a6e03c0459c723c98feb8b34d95413fa Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/4855044 Reviewed-by: Shu-yu Guo <[email protected]> Commit-Queue: Frank Tang <[email protected]> Cr-Commit-Position: refs/heads/main@{#90319}
… r=dminor Implements the changes from <tc39/ecma402#811>. Differential Revision: https://phabricator.services.mozilla.com/D204013
… r=dminor Implements the changes from <tc39/ecma402#811>. Differential Revision: https://phabricator.services.mozilla.com/D204013
Fixing issues created by #768 and additional issues about 'order' related to number format v3 and option read/ resolvedOptoins()
Move the reading of "roundingPriority" from before reading "roundingIncrement" to after reading "roundingMode" so these three fields are read in alphabetic order. https://tc39.es/ecma402/#sec-setnfdigitoptions
Move the output order of "roundingIncrement" from after output "roundingMode" to before that so these two fields are read in alphabetic order in the resolvedOptions of both Intl.NumberFormat and Intl.PluralRules. https://tc39.es/ecma402/#sec-intl.numberformat.prototype.resolvedoptions https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions
Move the output of "roundingPriority" from after "trailingZeroDisplay" before that to sync w/ Intl.NumberFormat after PR768. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions
Move the output of "pluralCategories" from after "trailingZeroDisplay" to before "roundingIncrement" so these options will be in alphabetic order. https://tc39.es/ecma402/#sec-intl.pluralrules.prototype.resolvedoptions