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

Normative: Sync the set of RoundingMode #2262

Merged
merged 5 commits into from
Sep 21, 2022
Merged

Conversation

FrankYFTang
Copy link
Contributor

after the landing of #2207
GetUnsignedRoundingMode now includes additional RoundingModes
expand, halfCeil, halfFloor, halfTrunc and halfEven.
Sync spec text in RoundNumberToIncrement, ToTemporalRoundingMode,
NegateTemporalRoundingMode to match it.

@sffc @ptomato

@codecov
Copy link

codecov bot commented Jun 8, 2022

Codecov Report

Merging #2262 (339ab3e) into main (0535c58) will decrease coverage by 13.23%.
The diff coverage is 87.09%.

❗ Current head 339ab3e differs from pull request most recent head edcb2e9. Consider uploading reports for the commit edcb2e9 to get more accurate results

@@             Coverage Diff             @@
##             main    #2262       +/-   ##
===========================================
- Coverage   95.01%   81.77%   -13.24%     
===========================================
  Files          20       17        -3     
  Lines       10803    10432      -371     
  Branches     1925     1476      -449     
===========================================
- Hits        10264     8531     -1733     
- Misses        503     1857     +1354     
- Partials       36       44        +8     
Flag Coverage Δ
tests 81.77% <87.09%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
polyfill/lib/ecmascript.mjs 87.03% <87.09%> (-11.26%) ⬇️
polyfill/lib/plaintime.mjs 37.82% <0.00%> (-62.18%) ⬇️
polyfill/lib/plainyearmonth.mjs 46.19% <0.00%> (-50.55%) ⬇️
polyfill/lib/plaindatetime.mjs 53.26% <0.00%> (-46.11%) ⬇️
polyfill/lib/plaindate.mjs 56.06% <0.00%> (-42.96%) ⬇️
polyfill/lib/intrinsicclass.mjs 48.64% <0.00%> (-40.55%) ⬇️
polyfill/lib/plainmonthday.mjs 55.81% <0.00%> (-39.54%) ⬇️
polyfill/lib/duration.mjs 69.93% <0.00%> (-27.49%) ⬇️
polyfill/lib/instant.mjs 75.12% <0.00%> (-21.40%) ⬇️
polyfill/lib/timezone.mjs 85.35% <0.00%> (-14.02%) ⬇️
... and 10 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Looks about right

@justingrant
Copy link
Collaborator

This change requires a change to the documentation too. @ptomato do you want to land the spec change separately from the docs change, or should we combine into the same PR? To find the affected places, search for 'ceil' in the docs folder.

@FrankYFTang
Copy link
Contributor Author

please review the change to the doc @sffc

@FrankYFTang FrankYFTang requested a review from sffc June 10, 2022 17:12
docs/duration.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@sffc sffc left a comment

Choose a reason for hiding this comment

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

Lots of duplicated docs

docs/instant.md Outdated Show resolved Hide resolved
Copy link
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

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

The spec part seems correct. Does it need to be presented in July or is it part of the NFv3 proposal? Or can we consider it "pre-approved" since we already had written in the Temporal proposal when it went to Stage 3 that we intended to sync the rounding modes with NFv3?

I think there is a bit more work necessary for the documentation but I'd also be content to split that out into a different PR, together with updating the polyfill to support these rounding modes (we will need to write test262 for them)

docs/duration.md Outdated Show resolved Hide resolved
docs/instant.md Outdated Show resolved Hide resolved
docs/instant.md Outdated Show resolved Hide resolved
@FrankYFTang
Copy link
Contributor Author

ok, I feel a little bit overwhelm about the opinion of the .md changes. how about this- make suggestion of what exactly how I should revert/modify the .md and I commit those first. I currently just try to copy/paste the same set of documenat to different .md but I do see your point that in some condictions that might not be the best way to approach that.

@ptomato
Copy link
Collaborator

ptomato commented Jun 21, 2022

@FrankYFTang Sure, I'm also fine if you would prefer that @justingrant or I take it from here. I think we can continue by pushing to this branch ourselves.

@ptomato
Copy link
Collaborator

ptomato commented Jun 21, 2022

I think it needs a rebase - this seems to be branched off of a commit before RoundNumberToIncrementAsIfPositive was added. The list of rounding modes in the header of that operation also needs to be modified.

@ptomato ptomato added spec-text Specification text involved non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! normative Would be a normative change to the proposal labels Jul 4, 2022
@ptomato
Copy link
Collaborator

ptomato commented Jul 4, 2022

@justingrant I made another attempt at the documentation, please have a look?

@ptomato ptomato requested a review from justingrant July 4, 2022 22:24
Copy link
Collaborator

@justingrant justingrant left a comment

Choose a reason for hiding this comment

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

Docs look good. I made a few minor suggestions.

docs/instant.md Show resolved Hide resolved
docs/instant.md Outdated Show resolved Hide resolved
ptomato added a commit to ptomato/test262 that referenced this pull request Sep 9, 2022
…tring tests

See tc39/proposal-temporal#2262, which reached
consensus in the July 2022 TC39 meeting. This change added several
rounding modes from the NumberFormat V3 proposal, some of which were
listed as invalid in the roundingmode-invalid-string tests. Remove these
items from the list of invalid modes, since they are no longer invalid.
ptomato added a commit to ptomato/test262 that referenced this pull request Sep 9, 2022
See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.

These tests use the same format as the previous ones. The tests for the
"half" rounding modes aren't very good yet, as they don't show any of the
differences between the tiebreaking schemes; there aren't any ties in the
data to be broken. (Except in .toString().) A subsequent commit will
correct this.
ptomato added a commit to ptomato/test262 that referenced this pull request Sep 9, 2022
The "half___" modes all round to the nearest increment except when there
is a tie. The previous tests didn't test rounding in the case of any ties
(except for .toString()) so here we use some different numbers in which
there is a tie, in order to make tests where the "half___" modes are more
thoroughly tested.

See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.
Ms2ger pushed a commit to ptomato/test262 that referenced this pull request Sep 21, 2022
…tring tests

See tc39/proposal-temporal#2262, which reached
consensus in the July 2022 TC39 meeting. This change added several
rounding modes from the NumberFormat V3 proposal, some of which were
listed as invalid in the roundingmode-invalid-string tests. Remove these
items from the list of invalid modes, since they are no longer invalid.
Ms2ger pushed a commit to ptomato/test262 that referenced this pull request Sep 21, 2022
See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.

These tests use the same format as the previous ones. The tests for the
"half" rounding modes aren't very good yet, as they don't show any of the
differences between the tiebreaking schemes; there aren't any ties in the
data to be broken. (Except in .toString().) A subsequent commit will
correct this.
Ms2ger pushed a commit to ptomato/test262 that referenced this pull request Sep 21, 2022
The "half___" modes all round to the nearest increment except when there
is a tie. The previous tests didn't test rounding in the case of any ties
(except for .toString()) so here we use some different numbers in which
there is a tie, in order to make tests where the "half___" modes are more
thoroughly tested.

See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.
Ms2ger pushed a commit to tc39/test262 that referenced this pull request Sep 21, 2022
…tring tests

See tc39/proposal-temporal#2262, which reached
consensus in the July 2022 TC39 meeting. This change added several
rounding modes from the NumberFormat V3 proposal, some of which were
listed as invalid in the roundingmode-invalid-string tests. Remove these
items from the list of invalid modes, since they are no longer invalid.
Ms2ger pushed a commit to tc39/test262 that referenced this pull request Sep 21, 2022
See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.

These tests use the same format as the previous ones. The tests for the
"half" rounding modes aren't very good yet, as they don't show any of the
differences between the tiebreaking schemes; there aren't any ties in the
data to be broken. (Except in .toString().) A subsequent commit will
correct this.
Ms2ger pushed a commit to tc39/test262 that referenced this pull request Sep 21, 2022
The "half___" modes all round to the nearest increment except when there
is a tie. The previous tests didn't test rounding in the case of any ties
(except for .toString()) so here we use some different numbers in which
there is a tie, in order to make tests where the "half___" modes are more
thoroughly tested.

See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.
FrankYFTang and others added 5 commits September 21, 2022 12:46
GetUnsignedRoundingMode now includes additional RoundingModes
expand, halfCeil, halfFloor, halfTrunc and halfEven.
Sync spec text in RoundNumberToIncrement, ToTemporalRoundingMode,
NegateTemporalRoundingMode to match it.
This brings the reference polyfill up to date with the new rounding modes.

It adds a quick set of tests that only test the internal implementation,
in order to make sure that the RoundNumberToIncrement operation behaves as
intended. Full tests should test the observable outcome in test262.
Note that for times, several pairs of rounding modes are equivalent to
each other (because times are never considered negative).
@ptomato ptomato merged commit 3877bd4 into tc39:main Sep 21, 2022
@ptomato
Copy link
Collaborator

ptomato commented Sep 21, 2022

This achieved consensus at the July 2022 TC39 meeting, and I've merged it now that the test262 tests are merged. (The change would have caused the old tests to fail.)

Copy link
Collaborator

@justingrant justingrant left a comment

Choose a reason for hiding this comment

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

Really top-notch work on the docs here. Amazingly clear explanation of really hard stuff. Thanks @ptomato!

catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 4, 2022
…tring tests

See tc39/proposal-temporal#2262, which reached
consensus in the July 2022 TC39 meeting. This change added several
rounding modes from the NumberFormat V3 proposal, some of which were
listed as invalid in the roundingmode-invalid-string tests. Remove these
items from the list of invalid modes, since they are no longer invalid.
catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 4, 2022
See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.

These tests use the same format as the previous ones. The tests for the
"half" rounding modes aren't very good yet, as they don't show any of the
differences between the tiebreaking schemes; there aren't any ties in the
data to be broken. (Except in .toString().) A subsequent commit will
correct this.
catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 4, 2022
The "half___" modes all round to the nearest increment except when there
is a tie. The previous tests didn't test rounding in the case of any ties
(except for .toString()) so here we use some different numbers in which
there is a tie, in order to make tests where the "half___" modes are more
thoroughly tested.

See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.
catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 5, 2022
…tring tests

See tc39/proposal-temporal#2262, which reached
consensus in the July 2022 TC39 meeting. This change added several
rounding modes from the NumberFormat V3 proposal, some of which were
listed as invalid in the roundingmode-invalid-string tests. Remove these
items from the list of invalid modes, since they are no longer invalid.
catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 5, 2022
See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.

These tests use the same format as the previous ones. The tests for the
"half" rounding modes aren't very good yet, as they don't show any of the
differences between the tiebreaking schemes; there aren't any ties in the
data to be broken. (Except in .toString().) A subsequent commit will
correct this.
catamorphism pushed a commit to catamorphism/test262 that referenced this pull request Oct 5, 2022
The "half___" modes all round to the nearest increment except when there
is a tie. The previous tests didn't test rounding in the case of any ties
(except for .toString()) so here we use some different numbers in which
there is a tie, in order to make tests where the "half___" modes are more
thoroughly tested.

See tc39/proposal-temporal#2262 which added new
rounding modes from NumberFormat V3.
@ptomato ptomato mentioned this pull request Jan 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
non-prod-polyfill THIS POLYFILL IS NOT FOR PRODUCTION USE! normative Would be a normative change to the proposal spec-text Specification text involved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants