Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Finish to/from methods for Temporal.PlainDate[Time]
https://bugs.webkit.org/show_bug.cgi?id=244436 Reviewed by Yusuke Suzuki. This patch implements the following for the Temporal API: - PlainDate: `from(object)`, toPlainDateTime - PlainDateTime: `from(object)`, toPlainDate, toPlainTime - PlainTime: toPlainDateTime - Calendar: dateFromFields (where the actual implementation of `PlainDate.from(object)` lives) It then enables test262 tests for all implemented methods of PlainDate and PlainDateTime, and subsequently recategorizes all of our existing Temporal failures, while fixing all imminently addressable issues. * JSTests/stress/temporal-calendar.js: * JSTests/stress/temporal-plaindate.js: * JSTests/stress/temporal-plaindatetime.js: * JSTests/stress/temporal-plaintime.js: * JSTests/test262/config.yaml: * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/ISO8601.cpp: (JSC::ISO8601::temporalDateToString): Fix six-digit year handling. (JSC::ISO8601::monthFromCode): Added. * Source/JavaScriptCore/runtime/ISO8601.h: * Source/JavaScriptCore/runtime/TemporalCalendar.cpp: (JSC::TemporalCalendar::toTemporalCalendarWithISODefault): Moved from TemporalPlainTime. (JSC::TemporalCalendar::getTemporalCalendarWithISODefault): Moved from TemporalPlainTime. (JSC::TemporalCalendar::isoDateFromFields): Added. * Source/JavaScriptCore/runtime/TemporalCalendar.h: * Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDate.cpp: (JSC::TemporalPlainDate::toPlainDate): Use max/min year constants to ensure that we *actually* stay within 21 bits. (JSC::TemporalPlainDate::tryCreateIfValid): (JSC::TemporalPlainDate::from): * Source/JavaScriptCore/runtime/TemporalPlainDate.h: Use decltype(auto) because year is int32_t. * Source/JavaScriptCore/runtime/TemporalPlainDateConstructor.cpp: (JSC::TemporalPlainDateConstructor::finishCreation): * Source/JavaScriptCore/runtime/TemporalPlainDatePrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDateTime.cpp: (JSC::TemporalPlainDateTime::tryCreateIfValid): (JSC::TemporalPlainDateTime::from): * Source/JavaScriptCore/runtime/TemporalPlainDateTime.h: Use decltype(auto) because year is int32_t. * Source/JavaScriptCore/runtime/TemporalPlainDateTimeConstructor.cpp: (JSC::TemporalPlainDateTimeConstructor::finishCreation): * Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainTime.cpp: (JSC::TemporalPlainTime::toTemporalTimeRecord): Made public static. (JSC::TemporalPlainTime::regulateTime): Made public static. (JSC::TemporalPlainTime::from): (JSC::toTemporalCalendarWithISODefault): Moved to TemporalPlainTime. (JSC::getTemporalCalendarWithISODefault): Moved to TemporalPlainTime. * Source/JavaScriptCore/runtime/TemporalPlainTime.h: * Source/JavaScriptCore/runtime/TemporalPlainTimePrototype.cpp: Canonical link: https://commits.webkit.org/253876@main
- Loading branch information
Showing
22 changed files
with
731 additions
and
488 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.