summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy Flynn <trflynn89@pm.me>2022-07-07 09:55:52 -0400
committerLinus Groh <mail@linusgroh.de>2022-07-08 11:51:54 +0200
commit2982aa0373786781c6583b8177cec50a3dd7392e (patch)
treeb8cf66e7ad9595c729ae7115244f5c73930c2390
parent8aeacccd82208ef3f74c41739978251b12a00ac8 (diff)
downloadserenity-2982aa0373786781c6583b8177cec50a3dd7392e.zip
LibJS: Mark the NumberFormat parameter of FormatNumericToString as const
Not critical, but in subsequent commits this will be invoked from a constant context.
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
index 1b38a9807b..79017c6d46 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
+++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp
@@ -344,7 +344,7 @@ int currency_digits(StringView currency)
}
// 15.5.3 FormatNumericToString ( intlObject, x ), https://tc39.es/ecma402/#sec-formatnumberstring
-FormatResult format_numeric_to_string(GlobalObject& global_object, NumberFormatBase& intl_object, Value number)
+FormatResult format_numeric_to_string(GlobalObject& global_object, NumberFormatBase const& intl_object, Value number)
{
// 1. If ℝ(x) < 0 or x is -0𝔽, let isNegative be true; else let isNegative be false.
bool is_negative = is_less_than(number, 0) || number.is_negative_zero();
diff --git a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h
index 171a24455c..ba36285086 100644
--- a/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h
+++ b/Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.h
@@ -221,7 +221,7 @@ struct RawFormatResult : public FormatResult {
};
int currency_digits(StringView currency);
-FormatResult format_numeric_to_string(GlobalObject& global_object, NumberFormatBase& intl_object, Value number);
+FormatResult format_numeric_to_string(GlobalObject& global_object, NumberFormatBase const& intl_object, Value number);
Vector<PatternPartition> partition_number_pattern(GlobalObject& global_object, NumberFormat& number_format, Value number);
Vector<PatternPartition> partition_notation_sub_pattern(GlobalObject& global_object, NumberFormat& number_format, Value number, String formatted_string, int exponent);
String format_numeric(GlobalObject& global_object, NumberFormat& number_format, Value number);