-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Temporal] Remove isoDateDifference() and use calendarDateUntil() instead #51889
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Temporal] Remove isoDateDifference() and use calendarDateUntil() instead #51889
Conversation
|
EWS run on current version of this PR (hash f7ea52d) Details |
|
Note: this PR changes the representation of tl;dr |
…tead https://bugs.webkit.org/show_bug.cgi?id=298564 Reviewed by Yusuke Suzuki. This affects the implementations of TemporalPlainDate::since() and TemporalPlainDate::until(), and enables some of the previously-failing tests for those methods. Also adds roundRelativeDuration() and its auxiliary functions (nudgeToCalendarUnit(), nudgeToDayOrTime(), bubbleRelativeDuration()), as this is required by calendarDateUntil(). Also fixes a bug where an out-of-range year could be passed in to the PlainDate constructor, resulting in integer overflow. * JSTests/stress/temporal-plaindate.js: (shouldBe): * JSTests/test262/config.yaml: * JSTests/test262/expectations.yaml: * Source/JavaScriptCore/runtime/ISO8601.cpp: (JSC::ISO8601::parseDate): (JSC::ISO8601::weekOfYear): (JSC::ISO8601::createISODateRecord): * Source/JavaScriptCore/runtime/ISO8601.h: * Source/JavaScriptCore/runtime/TemporalCalendar.cpp: (JSC::TemporalCalendar::balanceISODate): (JSC::TemporalCalendar::isoDateAdd): (JSC::TemporalCalendar::balanceISOYearMonth): (JSC::dateDuration): (JSC::isoDateSurpasses): (JSC::TemporalCalendar::calendarDateUntil): (JSC::TemporalCalendar::isoDateDifference): Deleted. * Source/JavaScriptCore/runtime/TemporalCalendar.h: * Source/JavaScriptCore/runtime/TemporalCalendarPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalDuration.cpp: (JSC::adjustDateDurationRecord): (JSC::combineISODateAndTimeRecord): (JSC::getUTCEpochNanoseconds): (JSC::getEpochNanosecondsFor): (JSC::nudgeToCalendarUnit): (JSC::nudgeToDayOrTime): (JSC::unitIndexInTable): (JSC::unitInTable): (JSC::bubbleRelativeDuration): (JSC::TemporalDuration::roundRelativeDuration): * Source/JavaScriptCore/runtime/TemporalDuration.h: * Source/JavaScriptCore/runtime/TemporalObject.h: * Source/JavaScriptCore/runtime/TemporalPlainDate.cpp: (JSC::TemporalPlainDate::toPlainDate): (JSC::getUTCEpochNanoseconds): (JSC::TemporalPlainDate::differenceTemporalPlainDate): (JSC::TemporalPlainDate::until): (JSC::TemporalPlainDate::since): * Source/JavaScriptCore/runtime/TemporalPlainDate.h: Canonical link: https://commits.webkit.org/301096@main
f7ea52d to
f1cf8d2
Compare
|
Committed 301096@main (f1cf8d2): https://commits.webkit.org/301096@main Reviewed commits have been landed. Closing PR #51889 and removing active labels. |
f1cf8d2
f7ea52d
🛠 win🧪 win-tests🛠 playstation