Skip to content

Commit

Permalink
Patch regression from change to to-relative-to-object
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss committed Jul 9, 2024
1 parent 5889a76 commit 878ebd3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions core/engine/src/builtins/temporal/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ pub(crate) fn to_relative_temporal_object(
let plain_date = match relative_to {
JsValue::String(relative_to_str) => JsValue::from(relative_to_str),
JsValue::Object(relative_to_obj) => JsValue::from(relative_to_obj),
JsValue::Undefined => return Ok((None, None)),
_ => {
return Err(JsNativeError::typ()
.with_message("Invalid type for converting to relativeTo object")
Expand Down
6 changes: 3 additions & 3 deletions core/engine/src/builtins/temporal/options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,12 @@ pub(crate) fn get_difference_settings(
context: &mut Context,
) -> JsResult<DifferenceSettings> {
let mut settings = DifferenceSettings::default();
settings.rounding_mode =
get_option::<TemporalRoundingMode>(options, js_str!("roundingMode"), context)?;
settings.largest_unit = get_option::<TemporalUnit>(options, js_str!("largestUnit"), context)?;
settings.increment =
get_option::<RoundingIncrement>(options, js_str!("roundingIncrement"), context)?;
settings.rounding_mode =
get_option::<TemporalRoundingMode>(options, js_str!("roundingMode"), context)?;
settings.smallest_unit = get_option::<TemporalUnit>(options, js_str!("smallestUnit"), context)?;
settings.largest_unit = get_option::<TemporalUnit>(options, js_str!("largestUnit"), context)?;
Ok(settings)
}

Expand Down

0 comments on commit 878ebd3

Please sign in to comment.