Skip to content
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: Refactor Calendar protocol for JsObjects #3651

Merged
merged 4 commits into from
Feb 4, 2024

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Feb 3, 2024

This Pull Request is related to ongoing #1804.

So a little background.

There was a test I noticed that, in theory, we should have been passing, but weren't.

The reason we weren't was due to only passing the inner date representation through the library, and recreating the PlainDate once into the custom calendar impl. But this meant that we couldn't do the strict equality compareArray asserts.

So after some initial prototyping about an AnyDateLike trait. I had a sidebar with @jedel1043, and he had a good idea of using an associated trait. 😄

Let me know what you all think!

It changes the following:

  • Adds DateLike associated Type to CalendarProtocol
  • Updates the API for the above change.

@nekevss nekevss force-pushed the refactor/calendar-associated-type branch from 12f41d2 to 02528e7 Compare February 3, 2024 16:07
Copy link

github-actions bot commented Feb 3, 2024

Test262 conformance changes

Test result main count PR count difference
Total 96,422 96,422 0
Passed 80,939 80,991 +52
Ignored 3,567 3,567 0
Failed 11,916 11,864 -52
Panics 0 0 0
Conformance 83.94% 84.00% +0.05%
Fixed tests (52):
test/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/weekOfYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/dayOfWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/dayOfWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/yearOfWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/monthCode/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/monthCode/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/day/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/day/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/monthsInYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/monthsInYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/inLeapYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/inLeapYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/month/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/month/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/year/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/year/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInMonth/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/daysInMonth/custom.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/dayOfYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/dayOfYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/weekOfYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/dayOfWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/yearOfWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/monthCode/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/monthCode/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/day/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/day/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/monthsInYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInWeek/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInWeek/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/inLeapYear/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/month/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/month/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/year/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/year/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInMonth/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/daysInMonth/custom.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/custom.js [strict mode] (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/dayOfYear/custom.js (previously Failed)

@nekevss nekevss added this to the v0.18.0 milestone Feb 3, 2024
@nekevss nekevss added builtins PRs and Issues related to builtins/intrinsics waiting-on-review Waiting on reviews from the maintainers labels Feb 3, 2024
@nekevss nekevss requested a review from a team February 3, 2024 18:10
Copy link
Member

@HalidOdat HalidOdat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! :)

@jedel1043 jedel1043 added this pull request to the merge queue Feb 4, 2024
Merged via the queue into main with commit d423bba Feb 4, 2024
13 checks passed
@HalidOdat HalidOdat deleted the refactor/calendar-associated-type branch February 4, 2024 06:42
@jedel1043 jedel1043 removed the waiting-on-review Waiting on reviews from the maintainers label Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
builtins PRs and Issues related to builtins/intrinsics
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants