1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

LibJS+LibUnicode: Make static const Utf8View variables constexpr

This commit is contained in:
Idan Horowitz 2022-01-16 20:34:09 +02:00 committed by Linus Groh
parent 4774bed589
commit 877ae85017
2 changed files with 2 additions and 2 deletions

View file

@ -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 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) { while (true) {
Utf8View utf8_pattern { pattern }; Utf8View utf8_pattern { pattern };

View file

@ -452,7 +452,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::pad_end)
return pad_string(global_object, move(string), PadPlacement::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) ThrowCompletionOr<String> trim_string(GlobalObject& global_object, Value input_value, TrimMode where)
{ {
// 1. Let str be ? RequireObjectCoercible(string). // 1. Let str be ? RequireObjectCoercible(string).