Skip to content

Conversation

@catamorphism
Copy link
Contributor

@catamorphism catamorphism commented Oct 6, 2025

52738be

[Temporal] Implement TemporalDuration::round() according to the spec
https://bugs.webkit.org/show_bug.cgi?id=298565

Reviewed by Yusuke Suzuki.

Also reimplement TemporalDuration::toString() according to the spec,
since it depends on round().

This enables some tests for Temporal/Duration/prototype/round and
Temporal/Duration/prototype/toString, as well as Temporal/Duration/from
(which uses toString).

* JSTests/stress/temporal-duration.js:
* JSTests/test262/config.yaml:
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/TemporalDuration.cpp:
(JSC::totalSeconds):
(JSC::totalSubseconds):
(JSC::TemporalDuration::balance):
(JSC::TemporalDuration::round):
(JSC::TemporalDuration::round const):
(JSC::TemporalDuration::toString const):
(JSC::defaultTemporalLargestUnit):
(JSC::TemporalDuration::toString):
(JSC::totalNanoseconds): Deleted.
* Source/JavaScriptCore/runtime/TemporalDuration.h:
* Source/JavaScriptCore/runtime/TemporalObject.cpp:
(JSC::roundNumberToIncrementDouble):
(JSC::roundNumberToIncrement): Deleted.
* Source/JavaScriptCore/runtime/TemporalObject.h:
* Source/JavaScriptCore/runtime/TemporalPlainTime.cpp:
(JSC::TemporalPlainTime::roundTime):

Canonical link: https://commits.webkit.org/301182@main

b6deb5e

Misc iOS, visionOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 win
✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug ✅ 🧪 wpe-wk2 💥 🧪 win-tests
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt ✅ 🧪 mac-wk1 ✅ 🛠 wpe-cairo
✅ 🛠 🧪 jsc ✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🛠 gtk
✅ 🛠 🧪 jsc-arm64 ✅ 🛠 vision ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 vision-sim ✅ 🧪 mac-wk2-stress ✅ 🧪 api-gtk
✅ 🧪 vision-wk2 ✅ 🧪 mac-intel-wk2 🛠 playstation
✅ 🛠 🧪 unsafe-merge ✅ 🛠 tv ✅ 🛠 mac-safer-cpp ✅ 🛠 jsc-armv7
✅ 🛠 tv-sim ✅ 🧪 jsc-armv7-tests
✅ 🛠 watch
✅ 🛠 watch-sim

@catamorphism catamorphism requested a review from a team as a code owner October 6, 2025 23:27
@catamorphism catamorphism self-assigned this Oct 6, 2025
@catamorphism catamorphism added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Oct 6, 2025
@catamorphism catamorphism added the request-merge-queue Request a pull request to be added to merge-queue once ready label Oct 7, 2025
@Constellation Constellation added unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed request-merge-queue Request a pull request to be added to merge-queue once ready labels Oct 8, 2025
https://bugs.webkit.org/show_bug.cgi?id=298565

Reviewed by Yusuke Suzuki.

Also reimplement TemporalDuration::toString() according to the spec,
since it depends on round().

This enables some tests for Temporal/Duration/prototype/round and
Temporal/Duration/prototype/toString, as well as Temporal/Duration/from
(which uses toString).

* JSTests/stress/temporal-duration.js:
* JSTests/test262/config.yaml:
* JSTests/test262/expectations.yaml:
* Source/JavaScriptCore/runtime/TemporalDuration.cpp:
(JSC::totalSeconds):
(JSC::totalSubseconds):
(JSC::TemporalDuration::balance):
(JSC::TemporalDuration::round):
(JSC::TemporalDuration::round const):
(JSC::TemporalDuration::toString const):
(JSC::defaultTemporalLargestUnit):
(JSC::TemporalDuration::toString):
(JSC::totalNanoseconds): Deleted.
* Source/JavaScriptCore/runtime/TemporalDuration.h:
* Source/JavaScriptCore/runtime/TemporalObject.cpp:
(JSC::roundNumberToIncrementDouble):
(JSC::roundNumberToIncrement): Deleted.
* Source/JavaScriptCore/runtime/TemporalObject.h:
* Source/JavaScriptCore/runtime/TemporalPlainTime.cpp:
(JSC::TemporalPlainTime::roundTime):

Canonical link: https://commits.webkit.org/301182@main
@webkit-commit-queue webkit-commit-queue force-pushed the balance-precision-split-1 branch from b6deb5e to 52738be Compare October 8, 2025 02:02
@webkit-commit-queue
Copy link
Collaborator

Committed 301182@main (52738be): https://commits.webkit.org/301182@main

Reviewed commits have been landed. Closing PR #51897 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 52738be into WebKit:main Oct 8, 2025
@webkit-commit-queue webkit-commit-queue removed the unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants