-
-
Notifications
You must be signed in to change notification settings - Fork 407
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
Swap to Duration::round from temporal_rs #3731
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3731 +/- ##
==========================================
+ Coverage 47.24% 47.66% +0.42%
==========================================
Files 476 454 -22
Lines 46892 44568 -2324
==========================================
- Hits 22154 21245 -909
+ Misses 24738 23323 -1415 ☔ View full report in Codecov by Sentry. |
Paired with boa-dev/temporal#34 gets
|
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.
Nice work on this overall!
Had a couple suggestions and a nitpick 😄
context: &mut Context, | ||
) -> RelativeTemporalObjectResult { | ||
let relative_to = options.get(PropertyKey::from(utf16!("relativeTo")), context)?; | ||
let plane_date = match relative_to { |
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.
nit: plain_date
over plane_date
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.
oops! lol
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.
Done
let _rounding_mode = get_option(&round_to, utf16!("roundingMode"), context)? | ||
.unwrap_or(RoundingMode::HalfExpand); | ||
let rounding_mode: Option<TemporalRoundingMode> = | ||
get_option::<RoundingMode>(&round_to, utf16!("roundingMode"), context)?.map(Into::into); |
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.
suggestion: you should be able to use get_option::<TemporalRoundingMode>
here as ParsableOptionType
is implemented for TemporalRoundingMode
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.
Done
Err(JsNativeError::range() | ||
.with_message("not yet implemented.") | ||
.into()) | ||
let duration = to_temporal_duration(this, context)?; |
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.
suggestion: this
along with to_temporal_duration
call can be replaced with the duration on line 605
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.
Done
This Pull Request fixes part of #{11}.
It changes the following:
temporal_rs
's