-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[Temporal] Implement comparison methods for PlainYearMonth #55076
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] Implement comparison methods for PlainYearMonth #55076
Conversation
|
EWS run on previous version of this PR (hash 436df1d) Details |
Source/JavaScriptCore/runtime/TemporalPlainYearMonthPrototype.cpp
Outdated
Show resolved
Hide resolved
| if (yearMonth->plainYearMonth() != other->plainYearMonth()) | ||
| return JSValue::encode(jsBoolean(false)); | ||
|
|
||
| return JSValue::encode(jsBoolean(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we compare calendar here like for PlainDate#equals ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On the one hand yes, on the other hand having different calendar values is currently not implemented...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PlainYearMonth doesn't have a calendar field yet, because as Philip mentioned, different calendars aren't implemented yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I know that different calendar is not implemented. However, I thought that if it would be needed in the future, it might as well be implemented in this PR for consistency with PlainDate#equals.
But I think this is a minor issue and will eventually be implemented and tested, so it is acceptable for me
|
EWS run on previous version of this PR (hash 962b9d5) Details |
962b9d5 to
97b1f6d
Compare
|
EWS run on current version of this PR (hash 97b1f6d) Details |
sosukesuzuki
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r=me
https://bugs.webkit.org/show_bug.cgi?id=303799 Reviewed by Sosuke Suzuki. Co-authored-by: SUZUKI Sosuke <aosukeke@gmail.com> Implement `compare`, `equals`, and `valueOf`. * JSTests/stress/temporal-plainyearmonth.js: (shouldBe): (shouldThrow): * JSTests/test262/config.yaml: * Source/JavaScriptCore/runtime/TemporalPlainYearMonthConstructor.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): * Source/JavaScriptCore/runtime/TemporalPlainYearMonthPrototype.cpp: (JSC::JSC_DEFINE_HOST_FUNCTION): Canonical link: https://commits.webkit.org/304196@main
97b1f6d to
bd18128
Compare
|
Committed 304196@main (bd18128): https://commits.webkit.org/304196@main Reviewed commits have been landed. Closing PR #55076 and removing active labels. |
bd18128
97b1f6d
🧪 win-tests🧪 api-ios🧪 gtk-wk2🛠 playstation