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 Temporal.PlainDate#{since, until}
https://bugs.webkit.org/show_bug.cgi?id=245550 Reviewed by Yusuke Suzuki. This patch implements the `since` / `until` methods for PlainDate (and accordingly the `dateUntil` method for Calendar). Since we haven't implemented `relativeTo` support for Duration yet, we must postpone implementation of: 1. the path where `smallestUnit` is set to `year`, `month`, or `week` 2. the entirety of `since` / `until` for PlainDateTime Otherwise, this completes the "ISO8601-only" implementation for PlainDate and PlainDateTime. * JSTests/stress/temporal-calendar.js: * JSTests/stress/temporal-plaindate.js: * JSTests/test262/config.yaml: * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/TemporalCalendar.cpp: (JSC::TemporalCalendar::isoDateDifference): Added. (JSC::TemporalCalendar::isoDateCompare): Moved from TemporalPlainDate. * Source/JavaScriptCore/runtime/TemporalCalendar.h: * Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp: * Source/JavaScriptCore/runtime/TemporalObject.cpp: (JSC::extractDifferenceOptions): Moved from TemporalPlainTime. (JSC::negateTemporalRoundingMode): Added. * Source/JavaScriptCore/runtime/TemporalObject.h: * Source/JavaScriptCore/runtime/TemporalPlainDate.cpp: (JSC::TemporalPlainDate::until): Added. (JSC::TemporalPlainDate::since): Added. (JSC::TemporalPlainDate::compare): Moved to TemporalCalendar. * Source/JavaScriptCore/runtime/TemporalPlainDate.h: * Source/JavaScriptCore/runtime/TemporalPlainDateConstructor.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDatePrototype.cpp: * Source/JavaScriptCore/runtime/TemporalPlainDateTime.cpp: (JSC::TemporalPlainDateTime::compare): * Source/JavaScriptCore/runtime/TemporalPlainTime.cpp: (JSC::TemporalPlainTime::until const): (JSC::TemporalPlainTime::since const): (JSC::extractDifferenceOptions): Moved to TemporalObject. Canonical link: https://commits.webkit.org/254780@main
- Loading branch information
Showing
15 changed files
with
483 additions
and
142 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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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
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.