mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-12 19:19:30 +00:00
LibJS: Use narrower types in Temporal PlainDate/PlainDateTime/Calendar
These are bounds-checked during construction of PlainDate/PlainDateTime and as such theres no need to widen them in these internal AO calls.
This commit is contained in:
parent
c5c32ad274
commit
2c6bd3a61b
Notes:
sideshowbarker
2024-07-18 08:18:57 +09:00
Author: https://github.com/IdanHo
Commit: 2c6bd3a61b
Pull-request: https://github.com/SerenityOS/serenity/pull/9023
Reviewed-by: https://github.com/linusg ✅
11 changed files with 47 additions and 49 deletions
|
@ -460,7 +460,7 @@ u16 iso_days_in_year(i32 year)
|
|||
}
|
||||
|
||||
// 12.1.32 ISODaysInMonth ( year, month ), https://tc39.es/proposal-temporal/#sec-temporal-isodaysinmonth
|
||||
i32 iso_days_in_month(i32 year, i32 month)
|
||||
u8 iso_days_in_month(i32 year, u8 month)
|
||||
{
|
||||
// 1. Assert: year is an integer.
|
||||
|
||||
|
@ -547,7 +547,7 @@ u8 to_iso_week_of_year(i32 year, u8 month, u8 day)
|
|||
}
|
||||
|
||||
// 12.1.36 BuildISOMonthCode ( month ), https://tc39.es/proposal-temporal/#sec-buildisomonthcode
|
||||
String build_iso_month_code(i32 month)
|
||||
String build_iso_month_code(u8 month)
|
||||
{
|
||||
return String::formatted("M{:02}", month);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue