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
Implement with and round methods for TemporalPlainDate[Time]
https://bugs.webkit.org/show_bug.cgi?id=245282 Reviewed by Yusuke Suzuki. This patch implements the following Temporal API methods: - PlainDate.prototype.with - PlainDateTime.prototype.{with, withPlainDate, withPlainTime, round} Note: `with` will likely need significant refactoring in the future. At present, the spec demands bafflingly inefficient behavior, observably calling out to Calendar multiple times and creating multiple intermediate JSObjects, even in the default case where the user is not making conscious use of Calendar at all. This is a showstopper, but one which Yusuke already reported in tc39/proposal-temporal#1808. * JSTests/stress/temporal-plaindate.js: * JSTests/stress/temporal-plaindatetime.js: * JSTests/test262/config.yaml: * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/TemporalCalendar.cpp: (JSC::TemporalCalendar::from): (JSC::TemporalCalendar::isoDateFromFields): Split into two. * Source/JavaScriptCore/runtime/TemporalCalendar.h: * Source/JavaScriptCore/runtime/TemporalObject.cpp: (JSC::rejectObjectWithCalendarOrTimeZone): Added. * Source/JavaScriptCore/runtime/TemporalObject.h: * Source/JavaScriptCore/runtime/TemporalPlainDate.cpp: (JSC::TemporalPlainDate::toPartialDate): Added. (JSC::TemporalPlainDate::with): Added. * Source/JavaScriptCore/runtime/TemporalPlainDate.h: * Source/JavaScriptCore/runtime/TemporalPlainDatePrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDateTime.cpp: (JSC::TemporalPlainDateTime::with): Added. (JSC::TemporalPlainDateTime::round): Added. * Source/JavaScriptCore/runtime/TemporalPlainDateTime.h: * Source/JavaScriptCore/runtime/TemporalPlainDateTimePrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainTime.cpp: (JSC::TemporalPlainTime::roundTime): (JSC::TemporalPlainTime::toTemporalTimeRecord): (JSC::TemporalPlainTime::toPartialTime): (JSC::TemporalPlainTime::with const): (JSC::toPartialTime): Made public static. * Source/JavaScriptCore/runtime/TemporalPlainTime.h: Canonical link: https://commits.webkit.org/254565@main
- Loading branch information
Showing
16 changed files
with
462 additions
and
38 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.