summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-01-16 20:34:09 +0200
committerLinus Groh <mail@linusgroh.de>2022-01-17 14:46:07 +0000
commit877ae8501783d7b7000fc9645fb2b85a2938a73b (patch)
treedb81c57d24cb1cbf5a0d0bfc08319a47f78271c7
parent4774bed58940987e6182a7f1fc78e9b56fa3e5e9 (diff)
downloadserenity-877ae8501783d7b7000fc9645fb2b85a2938a73b.zip
LibJS+LibUnicode: Make static const Utf8View variables constexpr
-rw-r--r--Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeNumberFormat.cpp2
-rw-r--r--Userland/Libraries/LibJS/Runtime/StringPrototype.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeNumberFormat.cpp b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeNumberFormat.cpp
index 605f9d21e5..715a3e3dc9 100644
--- a/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeNumberFormat.cpp
+++ b/Meta/Lagom/Tools/CodeGenerators/LibUnicode/GenerateUnicodeNumberFormat.cpp
@@ -308,7 +308,7 @@ static ErrorOr<void> parse_number_system_digits(String core_supplemental_path, U
static String parse_identifiers(String pattern, StringView replacement, UnicodeLocaleData& locale_data, NumberFormat& format)
{
- static Utf8View whitespace { "\u0020\u00a0\u200f"sv };
+ static constexpr Utf8View whitespace { "\u0020\u00a0\u200f"sv };
while (true) {
Utf8View utf8_pattern { pattern };
diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
index 10ae716e8d..ca715743b1 100644
--- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
+++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp
@@ -452,7 +452,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::pad_end)
return pad_string(global_object, move(string), PadPlacement::End);
}
-static Utf8View const whitespace_characters = Utf8View("\x09\x0A\x0B\x0C\x0D\x20\xC2\xA0\xE1\x9A\x80\xE2\x80\x80\xE2\x80\x81\xE2\x80\x82\xE2\x80\x83\xE2\x80\x84\xE2\x80\x85\xE2\x80\x86\xE2\x80\x87\xE2\x80\x88\xE2\x80\x89\xE2\x80\x8A\xE2\x80\xAF\xE2\x81\x9F\xE3\x80\x80\xE2\x80\xA8\xE2\x80\xA9\xEF\xBB\xBF"sv);
+static constexpr Utf8View whitespace_characters = Utf8View("\x09\x0A\x0B\x0C\x0D\x20\xC2\xA0\xE1\x9A\x80\xE2\x80\x80\xE2\x80\x81\xE2\x80\x82\xE2\x80\x83\xE2\x80\x84\xE2\x80\x85\xE2\x80\x86\xE2\x80\x87\xE2\x80\x88\xE2\x80\x89\xE2\x80\x8A\xE2\x80\xAF\xE2\x81\x9F\xE3\x80\x80\xE2\x80\xA8\xE2\x80\xA9\xEF\xBB\xBF"sv);
ThrowCompletionOr<String> trim_string(GlobalObject& global_object, Value input_value, TrimMode where)
{
// 1. Let str be ? RequireObjectCoercible(string).