From c9951ad26b72be75842fc538674c75d85b2f3d2f Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 9 Sep 2021 21:52:49 +0100 Subject: [PATCH] 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. --- Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index 17c03fa3b67..93a08d70876 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -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 to_temporal_time_record(GlobalObject& global_object, Object& temporal_time_like) +Optional to_temporal_time_record(GlobalObject& global_object, Object const& temporal_time_like) { auto& vm = global_object.vm(); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h index 388b30c23de..59c3130bb08 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.h @@ -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 to_temporal_time_record(GlobalObject&, Object& temporal_time_like); +Optional 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 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 day_length_ns = {});