Skip to content

Align Duration.prototype.round() to latest specification #317

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

Merged
merged 4 commits into from
May 26, 2025

Conversation

HalidOdat
Copy link
Member

Resolves #188

@HalidOdat HalidOdat added C-documentation Improvements or additions to documentation C-enhancement New feature or request labels May 25, 2025
@HalidOdat HalidOdat marked this pull request as draft May 25, 2025 16:53
@HalidOdat HalidOdat added C-internal Internal library improvements and removed C-documentation Improvements or additions to documentation labels May 25, 2025
@HalidOdat HalidOdat force-pushed the refactor/duration-prototype-round-align-spec branch from 857bc8b to 5494c45 Compare May 25, 2025 18:57
@HalidOdat
Copy link
Member Author

Running the test262 with boa with temporal main vs PR we get one plus passing test :)

Test262 conformance changes:
| Test result | main |    PR   | difference |
|    Passed   | 46897  | 46898 |     -1     |
|   Ignored   |  1634  | 1634  |     0      |
|   Failed    |  1723  | 1722  |     1      |
|   Panics    |   2    |   2   |     0      |

Fixed tests (1):
test/built-ins/Temporal/Duration/prototype/round/balances-up-to-weeks.js (previously Failed)

@HalidOdat HalidOdat marked this pull request as ready for review May 25, 2025 19:00
@HalidOdat HalidOdat requested a review from nekevss May 25, 2025 19:00
///
/// Spec: <https://tc39.es/proposal-temporal/#sec-temporal.duration.prototype.round>
///
// Spec last accessed: 2025-05-16, <https://github.com/tc39/proposal-temporal/tree/c150e7135c56afc9114032e93b53ac49f980d254>
Copy link
Member

Choose a reason for hiding this comment

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

Oooh, this is actually really useful! IMO we should start doing something like this for all our spec-related methods.

(with enough tooling put into it, we could have something that keeps track of the oldest parts of the codebase that could be out of date with the latest specification, but that's just an idea)

Copy link
Member Author

@HalidOdat HalidOdat May 25, 2025

Choose a reason for hiding this comment

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

(with enough tooling put into it, we could have something that keeps track of the oldest parts of the codebase that could be out of date with the latest specification, but that's just an idea)

I like the idea of a tool for checking spec docs, maybe we should have something more structured so it's easier to parse and harder to mistype, maybe something like:

Spec(2025-05-16): <https://github.com/tc39/proposal-temporal/tree/c150e7135c56afc9114032e93b53ac49f980d254>

Or maybe just a date so it's easier to type, should be enough info to pin point a commit?

git log --oneline --since="2025-01-05" --until="2025-01-06"

Copy link
Member

@nekevss nekevss left a comment

Choose a reason for hiding this comment

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

This looks good to me overall. Were you planning on looking into the abstract methods of round as well or were they all basically up to date?

@HalidOdat
Copy link
Member Author

HalidOdat commented May 26, 2025

[..] Were you planning on looking into the abstract methods of round as well or were they all basically up to date?

I'll look into the abstract methods in a separate PR, don't want this PR to become too big 😅 From what I saw they where up-to-date at least the ones that where called directly in round.

@nekevss
Copy link
Member

nekevss commented May 26, 2025

Sounds good to me. I'm fine with this merged as is. I'm mostly concerned about BubbleRelativeDuration. I think its bugged based off some of the tests, but it could be out of date as well.

@nekevss nekevss merged commit 6b46e28 into main May 26, 2025
8 checks passed
@HalidOdat HalidOdat deleted the refactor/duration-prototype-round-align-spec branch May 27, 2025 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement New feature or request C-internal Internal library improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update Duration.prototype.round to latest spec
3 participants