diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h index a2f15493ab..dbd75a3930 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.h @@ -31,7 +31,7 @@ struct LocaleResult { struct PatternPartition { StringView type; - StringView value; + String value; }; Optional is_structurally_valid_language_tag(StringView locale); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp index 21fc042bc4..5ebec91ef4 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/ListFormat.cpp @@ -83,14 +83,14 @@ Vector deconstruct_pattern(StringView pattern, Placeables plac Vector result {}; // 3. For each Record { [[Type]], [[Value]] } patternPart of patternParts, do - for (auto const& pattern_part : pattern_parts) { + for (auto& pattern_part : pattern_parts) { // a. Let part be patternPart.[[Type]]. auto part = pattern_part.type; // b. If part is "literal", then if (part == "literal"sv) { // i. Append Record { [[Type]]: "literal", [[Value]]: patternPart.[[Value]] } to result. - result.append({ part, pattern_part.value }); + result.append({ part, move(pattern_part.value) }); } // c. Else, else { @@ -219,9 +219,9 @@ String format_list(ListFormat const& list_format, Vector const& list) StringBuilder result; // 3. For each Record { [[Type]], [[Value]] } part in parts, do - for (auto const& part : parts) { + for (auto& part : parts) { // a. Set result to the string-concatenation of result and part.[[Value]]. - result.append(part.value); + result.append(move(part.value)); } // 4. Return result. @@ -243,7 +243,7 @@ Array* format_list_to_parts(GlobalObject& global_object, ListFormat const& list_ size_t n = 0; // 4. For each Record { [[Type]], [[Value]] } part in parts, do - for (auto const& part : parts) { + for (auto& part : parts) { // a. Let O be OrdinaryObjectCreate(%Object.prototype%). auto* object = Object::create(global_object, global_object.object_prototype()); @@ -251,7 +251,7 @@ Array* format_list_to_parts(GlobalObject& global_object, ListFormat const& list_ MUST(object->create_data_property_or_throw(vm.names.type, js_string(vm, part.type))); // c. Perform ! CreateDataPropertyOrThrow(O, "value", part.[[Value]]). - MUST(object->create_data_property_or_throw(vm.names.value, js_string(vm, part.value))); + MUST(object->create_data_property_or_throw(vm.names.value, js_string(vm, move(part.value)))); // d. Perform ! CreateDataPropertyOrThrow(result, ! ToString(n), O). MUST(result->create_data_property_or_throw(n, object));