Skip to content

Conversation

catamorphism
Copy link
Contributor

@catamorphism catamorphism commented Oct 8, 2025

dab2cf7

[Temporal] Add PlainMonthDay
https://bugs.webkit.org/show_bug.cgi?id=300389

Reviewed by Yusuke Suzuki.

Add basic support for Temporal PlainMonthDay type, without most
methods yet.

Test: JSTests/stress/temporal-plainmonthday.js
* JSTests/stress/temporal-plainmonthday.js: Added.
(shouldBe):
(shouldThrow):
(const.monthDay.new.Temporal.PlainMonthDay):
* JSTests/test262/config.yaml:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/runtime/ISO8601.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::plainMonthDayStructure):
* Source/JavaScriptCore/runtime/TemporalObject.cpp:
(JSC::createPlainMonthDayConstructor):
(JSC::toTemporalOverflow):
* Source/JavaScriptCore/runtime/TemporalObject.h:
* Source/JavaScriptCore/runtime/TemporalPlainMonthDay.cpp: Added.
(JSC::TemporalPlainMonthDay::create):
(JSC::TemporalPlainMonthDay::createStructure):
(JSC::TemporalPlainMonthDay::TemporalPlainMonthDay):
(JSC::TemporalPlainMonthDay::finishCreation):
(JSC::TemporalPlainMonthDay::visitChildrenImpl):
(JSC::TemporalPlainMonthDay::tryCreateIfValid):
(JSC::TemporalPlainMonthDay::monthCode const):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDay.h: Added.
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.cpp: Added.
(JSC::TemporalPlainMonthDayConstructor::create):
(JSC::TemporalPlainMonthDayConstructor::createStructure):
(JSC::TemporalPlainMonthDayConstructor::TemporalPlainMonthDayConstructor):
(JSC::TemporalPlainMonthDayConstructor::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.h: Added.
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayPrototype.cpp: Added.
(JSC::TemporalPlainMonthDayPrototype::create):
(JSC::TemporalPlainMonthDayPrototype::createStructure):
(JSC::TemporalPlainMonthDayPrototype::TemporalPlainMonthDayPrototype):
(JSC::TemporalPlainMonthDayPrototype::finishCreation):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayPrototype.h: Added.

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

299221f

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 8, 2025 15:18
@catamorphism catamorphism self-assigned this Oct 8, 2025
@catamorphism catamorphism added the JavaScriptCore For bugs in JavaScriptCore, the JS engine used by WebKit, other than kxmlcore issues. label Oct 8, 2025
@catamorphism catamorphism force-pushed the plainmonthday-plainyearmonth-part-2 branch from ea57bb2 to d2bab08 Compare October 8, 2025 15:24
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Oct 8, 2025
: year(y), month(m) { }
};

class PlainMonthDay {
Copy link
Member

Choose a reason for hiding this comment

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

Also, that PlainDate's year's double looks bad. It must be int32_t and out of range year should be represented via special Int32. Using double is supper slow. Can you add a FIXME? I think we cannot enable Temporal until it gets fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a FIXME -- also, what do you mean by "special Int32"?

Copy link
Member

Choose a reason for hiding this comment

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

Indicating Out-of-range via INT32_MIN for example.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah this is changed in f1cf8d2, this is not OK. This is hard blocker for enablement definitely.

@catamorphism catamorphism force-pushed the plainmonthday-plainyearmonth-part-2 branch from d2bab08 to 299221f Compare October 8, 2025 18:45
@catamorphism catamorphism added request-merge-queue Request a pull request to be added to merge-queue once ready and removed merging-blocked Applied to prevent a change from being merged labels Oct 8, 2025
@fujii fujii 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 9, 2025
https://bugs.webkit.org/show_bug.cgi?id=300389

Reviewed by Yusuke Suzuki.

Add basic support for Temporal PlainMonthDay type, without most
methods yet.

Test: JSTests/stress/temporal-plainmonthday.js
* JSTests/stress/temporal-plainmonthday.js: Added.
(shouldBe):
(shouldThrow):
(const.monthDay.new.Temporal.PlainMonthDay):
* JSTests/test262/config.yaml:
* Source/JavaScriptCore/CMakeLists.txt:
* Source/JavaScriptCore/DerivedSources.make:
* Source/JavaScriptCore/Sources.txt:
* Source/JavaScriptCore/runtime/ISO8601.h:
* Source/JavaScriptCore/runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildrenImpl):
* Source/JavaScriptCore/runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::plainMonthDayStructure):
* Source/JavaScriptCore/runtime/TemporalObject.cpp:
(JSC::createPlainMonthDayConstructor):
(JSC::toTemporalOverflow):
* Source/JavaScriptCore/runtime/TemporalObject.h:
* Source/JavaScriptCore/runtime/TemporalPlainMonthDay.cpp: Added.
(JSC::TemporalPlainMonthDay::create):
(JSC::TemporalPlainMonthDay::createStructure):
(JSC::TemporalPlainMonthDay::TemporalPlainMonthDay):
(JSC::TemporalPlainMonthDay::finishCreation):
(JSC::TemporalPlainMonthDay::visitChildrenImpl):
(JSC::TemporalPlainMonthDay::tryCreateIfValid):
(JSC::TemporalPlainMonthDay::monthCode const):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDay.h: Added.
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.cpp: Added.
(JSC::TemporalPlainMonthDayConstructor::create):
(JSC::TemporalPlainMonthDayConstructor::createStructure):
(JSC::TemporalPlainMonthDayConstructor::TemporalPlainMonthDayConstructor):
(JSC::TemporalPlainMonthDayConstructor::finishCreation):
(JSC::JSC_DEFINE_HOST_FUNCTION):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayConstructor.h: Added.
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayPrototype.cpp: Added.
(JSC::TemporalPlainMonthDayPrototype::create):
(JSC::TemporalPlainMonthDayPrototype::createStructure):
(JSC::TemporalPlainMonthDayPrototype::TemporalPlainMonthDayPrototype):
(JSC::TemporalPlainMonthDayPrototype::finishCreation):
(JSC::JSC_DEFINE_CUSTOM_GETTER):
* Source/JavaScriptCore/runtime/TemporalPlainMonthDayPrototype.h: Added.

Canonical link: https://commits.webkit.org/301244@main
@webkit-commit-queue webkit-commit-queue force-pushed the plainmonthday-plainyearmonth-part-2 branch from 299221f to dab2cf7 Compare October 9, 2025 03:28
@webkit-commit-queue
Copy link
Collaborator

Committed 301244@main (dab2cf7): https://commits.webkit.org/301244@main

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

@webkit-commit-queue webkit-commit-queue merged commit dab2cf7 into WebKit:main Oct 9, 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 9, 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.

6 participants