LibJS: Make to_temporal_time_record() time like Object a const&

This only calls Object::get() on the temporal_time_like Object, which is
const-qualified.
This commit is contained in:
Linus Groh 2021-09-09 21:52:49 +01:00
parent 77a18392ff
commit c9951ad26b
Notes: sideshowbarker 2024-07-18 04:21:19 +09:00
2 changed files with 2 additions and 2 deletions

View File

@ -374,7 +374,7 @@ PlainTime* create_temporal_time(GlobalObject& global_object, u8 hour, u8 minute,
}
// 4.5.9 ToTemporalTimeRecord ( temporalTimeLike ), https://tc39.es/proposal-temporal/#sec-temporal-totemporaltimerecord
Optional<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject& global_object, Object& temporal_time_like)
Optional<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject& global_object, Object const& temporal_time_like)
{
auto& vm = global_object.vm();

View File

@ -97,7 +97,7 @@ bool is_valid_time(double hour, double minute, double second, double millisecond
DaysAndTime balance_time(i64 hour, i64 minute, i64 second, i64 millisecond, i64 microsecond, i64 nanosecond);
TemporalTime constrain_time(double hour, double minute, double second, double millisecond, double microsecond, double nanosecond);
PlainTime* create_temporal_time(GlobalObject&, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, FunctionObject const* new_target = nullptr);
Optional<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject&, Object& temporal_time_like);
Optional<UnregulatedTemporalTime> to_temporal_time_record(GlobalObject&, Object const& temporal_time_like);
String temporal_time_to_string(u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, Variant<StringView, u8> const& precision);
i8 compare_temporal_time(u8 hour1, u8 minute1, u8 second1, u16 millisecond1, u16 microsecond1, u16 nanosecond1, u8 hour2, u8 minute2, u8 second2, u16 millisecond2, u16 microsecond2, u16 nanosecond2);
DaysAndTime round_time(GlobalObject&, u8 hour, u8 minute, u8 second, u16 millisecond, u16 microsecond, u16 nanosecond, u64 increment, StringView unit, StringView rounding_mode, Optional<double> day_length_ns = {});