LibJS: Pass ISO types by value vs. const-reference more correctly

We were passing types like ISODate by reference so that they could be
used as forward-declarations. But after commit 021a5f4ded, we now have
their full definitions anywhere they're needed. So let's pass ISODate by
value everywhere consistently - it is only 8 bytes.
This commit is contained in:
Timothy Flynn 2024-11-26 08:41:52 -05:00 committed by Tim Flynn
commit ade510fe17
Notes: github-actions[bot] 2024-11-26 16:36:32 +00:00
6 changed files with 20 additions and 20 deletions

View file

@ -75,7 +75,7 @@ double epoch_days_to_epoch_ms(double day, double time)
}
// 13.4 CheckISODaysRange ( isoDate ), https://tc39.es/proposal-temporal/#sec-checkisodaysrange
ThrowCompletionOr<void> check_iso_days_range(VM& vm, ISODate const& iso_date)
ThrowCompletionOr<void> check_iso_days_range(VM& vm, ISODate iso_date)
{
// 1. If abs(ISODateToEpochDays(isoDate.[[Year]], isoDate.[[Month]] - 1, isoDate.[[Day]])) > 10**8, then
if (fabs(iso_date_to_epoch_days(iso_date.year, iso_date.month - 1, iso_date.day)) > 100'000'000) {
@ -1725,7 +1725,7 @@ ThrowCompletionOr<String> to_offset_string(VM& vm, Value argument)
}
// 13.42 ISODateToFields ( calendar, isoDate, type ), https://tc39.es/proposal-temporal/#sec-temporal-isodatetofields
CalendarFields iso_date_to_fields(StringView calendar, ISODate const& iso_date, DateType type)
CalendarFields iso_date_to_fields(StringView calendar, ISODate iso_date, DateType type)
{
// 1. Let fields be an empty Calendar Fields Record with all fields set to unset.
auto fields = CalendarFields::unset();