1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +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:
Idan Horowitz 2021-07-26 16:48:47 +03:00 committed by Linus Groh
parent c5c32ad274
commit 2c6bd3a61b
11 changed files with 47 additions and 49 deletions

View file

@ -33,25 +33,23 @@ struct ISODateTime {
Optional<String> calendar = {};
};
// FIXME: Use more narrow types for most of these (u8/u16)
struct TemporalInstant {
i32 year;
i32 month;
i32 day;
i32 hour;
i32 minute;
i32 second;
i32 millisecond;
i32 microsecond;
i32 nanosecond;
u8 month;
u8 day;
u8 hour;
u8 minute;
u8 second;
u16 millisecond;
u16 microsecond;
u16 nanosecond;
Optional<String> time_zone_offset;
};
// FIXME: Use more narrow type for month/day (u8)
struct TemporalDate {
i32 year;
i32 month;
i32 day;
u8 month;
u8 day;
Optional<String> calendar;
};