From c099b1b8a565b0f74ddf56c161f52de4b52aecec Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Thu, 9 Sep 2021 21:35:57 +0100 Subject: [PATCH] LibJS: Make get_option() options Object a const& This only calls Object::get() on the options Object, which is const-qualified. --- .../Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp | 2 +- Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index acdfda04ca..04e8d3d058 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -103,7 +103,7 @@ Object* get_options_object(GlobalObject& global_object, Value options) } // 13.3 GetOption ( options, property, types, values, fallback ), https://tc39.es/proposal-temporal/#sec-getoption -Value get_option(GlobalObject& global_object, Object& options, PropertyName const& property, Vector const& types, Vector const& values, Value fallback) +Value get_option(GlobalObject& global_object, Object const& options, PropertyName const& property, Vector const& types, Vector const& values, Value fallback) { VERIFY(property.is_string()); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h index 8e256c8294..deed584a0b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.h @@ -85,7 +85,7 @@ struct SecondsStringPrecision { MarkedValueList iterable_to_list_of_type(GlobalObject&, Value items, Vector const& element_types); Object* get_options_object(GlobalObject&, Value options); -Value get_option(GlobalObject&, Object& options, PropertyName const& property, Vector const& types, Vector const& values, Value fallback); +Value get_option(GlobalObject&, Object const& options, PropertyName const& property, Vector const& types, Vector const& values, Value fallback); template Optional> get_string_or_number_option(GlobalObject&, Object& options, PropertyName const& property, Vector const& string_values, NumberType minimum, NumberType maximum, Value fallback); Optional to_temporal_overflow(GlobalObject&, Object& normalized_options);