mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 08:39:22 +00:00
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:
parent
2d9405e5d7
commit
ade510fe17
Notes:
github-actions[bot]
2024-11-26 16:36:32 +00:00
Author: https://github.com/trflynn89
Commit: ade510fe17
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2590
Reviewed-by: https://github.com/gmta ✅
6 changed files with 20 additions and 20 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue