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

Updates to temporal_rs version and temporal methods #3900

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

nekevss
Copy link
Member

@nekevss nekevss commented Jul 8, 2024

This Pull Request is related to the ongoing work for temporal.

It changes the following:

  • Bumps temporal_rs to 0.0.3
  • Implements more of the functionality already implemented in temporal_rs
  • Adds to_temporal_time and to_temporal_datetime abstract operations

Copy link

github-actions bot commented Jul 8, 2024

Test262 conformance changes

Test result main count PR count difference
Total 48,212 48,212 0
Passed 42,737 42,851 +114
Ignored 1,413 1,413 0
Failed 4,062 3,948 -114
Panics 0 0 0
Conformance 88.64% 88.88% +0.24%
Fixed tests (140):
test/built-ins/Temporal/PlainTime/from/argument-plaindatetime.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/builtin.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/overflow-invalid-string.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/argument-plaintime.js (previously Failed)
test/built-ins/Temporal/PlainTime/from/name.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/hour/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/round/smallestunit-plurals-accepted.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/round/smallestunit-string-shorthand.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/builtin.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/length.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/name.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/equals/branding.js (previously Failed)
test/built-ins/Temporal/PlainTime/prototype/add/argument-duration.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-optional-data.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/parser.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-year-zero.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-time-zone-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-plaindatetime.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-plaindate.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/builtin.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-calendar-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-unknown-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/name.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-time-separators.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/from/argument-string-timezone.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/withCalendar/missing-argument.js (previously Failed)
test/built-ins/Temporal/PlainDateTime/prototype/add/argument-duration.js (previously Failed)
test/built-ins/Temporal/Duration/from/subclassing-ignored.js (previously Failed)
test/built-ins/Temporal/Duration/from/non-integer-throws-rangeerror.js (previously Failed)
test/built-ins/Temporal/Duration/from/argument-duration.js (previously Failed)
test/built-ins/Temporal/Duration/from/builtin.js (previously Failed)
test/built-ins/Temporal/Duration/from/prop-desc.js (previously Failed)
test/built-ins/Temporal/Duration/from/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/Duration/from/length.js (previously Failed)
test/built-ins/Temporal/Duration/from/argument-string-fractional-precision.js (previously Failed)
test/built-ins/Temporal/Duration/from/name.js (previously Failed)
test/built-ins/Temporal/Duration/from/argument-object-invalid.js (previously Failed)
test/built-ins/Temporal/Duration/from/argument-existing-object.js (previously Failed)
test/built-ins/Temporal/Duration/from/string-with-skipped-units.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/round/relativeto-number.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/round/largestunit-smallestunit-mismatch.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/blank/basic.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/total/relativeto-number.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/total/relativeto-string-plaindatetime-invalid.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/with/sign-replace.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/subclassing-ignored.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/argument-invalid-property.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/argument-string-negative-fractional-units.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/argument-string-fractional-units-rounding-mode.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/argument-singular-properties.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/balance-negative-time-units.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/balance-negative-result.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/subtract/branding.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/subclassing-ignored.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/argument-invalid-property.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/argument-string-negative-fractional-units.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/argument-string-fractional-units-rounding-mode.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/argument-singular-properties.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/balance-negative-time-units.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/balance-negative-result.js (previously Failed)
test/built-ins/Temporal/Duration/prototype/add/branding.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-time-zone-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-date-with-utc-offset.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/subclassing-ignored.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-minus-sign.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-plaindatetime.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-critical-unknown-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-plaindate.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-trailing-junk.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-multiple-calendar.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/builtin.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-invalid.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-unknown-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/name.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/year-zero.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-time-separators.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-multiple-time-zone.js (previously Failed)
test/built-ins/Temporal/PlainDate/from/argument-string-calendar-annotation-invalid-key.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/largestunit-default.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/no-options.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/days-in-year.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/largestunit-week.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/largestunit-year.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/largestunit-day.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/rounding-relative.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/until/days-in-month.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-time-zone-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-date-with-utc-offset.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-minus-sign.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-plaindatetime.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-critical-unknown-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-multiple-calendar.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/basic.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-invalid.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-number.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-unknown-annotation.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/year-zero.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-time-separators.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-multiple-time-zone.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/argument-string-calendar-annotation-invalid-key.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/equals/branding.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/builtin.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/prop-desc.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/not-a-constructor.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/name.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/branding.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/subtract/limits.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-reject.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/subtract/basic.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/subtract/overflow-constrain.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-years-weeks.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/limits.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-weeks-days.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-years-months.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/overflow-reject.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-years-months-days.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-months.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-months-weeks.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/basic.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-days.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-weeks.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/add-years.js (previously Failed)
test/built-ins/Temporal/PlainDate/prototype/add/overflow-constrain.js (previously Failed)
test/intl402/Temporal/PlainDate/prototype/equals/argument-string.js (previously Failed)
test/intl402/Temporal/PlainDate/prototype/equals/calendar-is-compared.js (previously Failed)
test/language/statements/class/elements/super-access-inside-a-private-method.js (previously Failed)
test/staging/Temporal/Regex/old/plaindate.js (previously Failed)
test/staging/Temporal/Regex/old/duration.js (previously Failed)
Broken tests (26):
test/built-ins/Temporal/PlainDateTime/from/argument-propertybag-calendar-number.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/smallestunit-plurals-accepted-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/largestunit-wrong-type.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingincrement-wrong-type.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/round-negative-result.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/subclassing-ignored.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingincrement-undefined.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/smallestunit-wrong-type.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingmode-undefined.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/smallestunit-string-shorthand-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingmode-invalid-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/largestunit-undefined.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/smallestunit-undefined.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/balance-subseconds.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/balance-negative-result.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/smallestunit-invalid-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingincrement-nan.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundto-invalid-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/round/roundingmode-wrong-type.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/total/unit-disallowed-units-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/total/unit-invalid-string.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/subtract/argument-duration-out-of-range.js (previously Passed)
test/built-ins/Temporal/Duration/prototype/add/argument-duration-out-of-range.js (previously Passed)
test/built-ins/Temporal/PlainDate/from/argument-propertybag-calendar-number.js (previously Passed)
test/built-ins/Temporal/PlainDate/prototype/toPlainDateTime/time-invalid.js (previously Passed)
test/intl402/Temporal/PlainDate/from/one-of-era-erayear-undefined.js (previously Passed)

@nekevss nekevss requested a review from a team July 8, 2024 12:52
@nekevss
Copy link
Member Author

nekevss commented Jul 8, 2024

After a spot check, the new broken tests appear to be previous false positives on from method calls, so there shouldn't be any regressions.

@nekevss nekevss added this to the v0.19.0 milestone Jul 8, 2024
Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

Overall good! I just have a small suggestion.

@@ -254,7 +254,8 @@ pub(crate) fn to_relative_temporal_object(
JsValue::Object(relative_to_obj) => Some(relative_to_obj.into()),
_ => None,
}
.map(|plane_date| Ok::<_, JsError>(to_temporal_date(&plane_date, None, context)?.inner))
.map(|plain_date| Ok::<_, JsError>(to_temporal_date(&plain_date, None, context)))
Copy link
Member

Choose a reason for hiding this comment

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

Thought: The previous match could probably be rewritten to use an early return on None. It would simplify this part by a lot.

Copy link
Member

@jedel1043 jedel1043 left a comment

Choose a reason for hiding this comment

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

LGTM!

@nekevss nekevss added this pull request to the merge queue Jul 8, 2024
Merged via the queue into main with commit 5889a76 Jul 8, 2024
13 checks passed
@raskad raskad deleted the update-temporal-version-and-methods branch July 9, 2024 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants