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

Round epoch time getters towards negative infinity #3802

Merged
merged 1 commit into from
Apr 10, 2023

Conversation

anba
Copy link
Contributor

@anba anba commented Mar 24, 2023

Update tests to match tc39/proposal-temporal#2424.

@anba anba requested a review from a team as a code owner March 24, 2023 12:26
Copy link
Contributor

@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.

Thanks, you are correct about this. I had looked at these tests before and mistakenly thought that they already tested for the new behaviour; with your changes they're correct.

ptomato added a commit to tc39/proposal-temporal that referenced this pull request Apr 8, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).
@Ms2ger Ms2ger merged commit 8866567 into tc39:main Apr 10, 2023
ptomato added a commit to tc39/proposal-temporal that referenced this pull request Apr 10, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).
ptomato added a commit to tc39/proposal-temporal that referenced this pull request Apr 10, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).
justingrant pushed a commit to tc39/proposal-temporal that referenced this pull request Apr 20, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
justingrant pushed a commit to justingrant/temporal-polyfill that referenced this pull request Apr 25, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
justingrant pushed a commit to justingrant/temporal-polyfill that referenced this pull request Apr 25, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
justingrant pushed a commit to justingrant/temporal-polyfill that referenced this pull request Apr 25, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
justingrant pushed a commit to justingrant/temporal-polyfill that referenced this pull request Apr 26, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
justingrant pushed a commit to js-temporal/temporal-polyfill that referenced this pull request Apr 26, 2023
See #2423 for the issue and #2424 for the spec text change, which was
already adopted some time ago. I thought the reference code already worked
like this, but it does not.

Anba pointed this out in tc39/test262#3802 and
provided correct test262 tests for the feature.

Note that the big-integer library doesn't have a floor division function.
We roll our own. If the divisor or dividend is negative (but not both) and
there is a remainder, then we subtract 1 from the result (round towards
negative infinity instead of 0).

UPSTREAM_COMMIT=6e0ad2030170540084a4a400005cc2bc8c791bdb
@anba anba deleted the round-towards-neg-inf branch September 28, 2023 12:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants