diff options
Diffstat (limited to 'Userland/Libraries/LibJS')
49 files changed, 132 insertions, 132 deletions
diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 37832debcd..dc4b5b0a8e 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -3385,7 +3385,7 @@ Completion ImportCall::execute(Interpreter& interpreter) const // 7. Let specifierString be Completion(ToString(specifier)). // 8. IfAbruptRejectPromise(specifierString, promiseCapability). - auto specifier_string = TRY_OR_REJECT_WITH_VALUE(vm, promise_capability, specifier->to_string(vm)); + auto specifier_string = TRY_OR_REJECT_WITH_VALUE(vm, promise_capability, specifier->to_deprecated_string(vm)); // 9. Let assertions be a new empty List. Vector<ModuleRequest::Assertion> assertions; @@ -3623,7 +3623,7 @@ Completion TemplateLiteral::execute(Interpreter& interpreter) const auto sub = TRY(expression.execute(interpreter)).release_value(); // 4. Let middle be ? ToString(sub). - auto string = TRY(sub.to_string(vm)); + auto string = TRY(sub.to_deprecated_string(vm)); string_builder.append(string); // 5. Let tail be the result of evaluating TemplateSpans. diff --git a/Userland/Libraries/LibJS/Console.cpp b/Userland/Libraries/LibJS/Console.cpp index 69837cf1e8..b266734a81 100644 --- a/Userland/Libraries/LibJS/Console.cpp +++ b/Userland/Libraries/LibJS/Console.cpp @@ -120,7 +120,7 @@ ThrowCompletionOr<Value> Console::count() auto& vm = realm().vm(); // NOTE: "default" is the default value in the IDL. https://console.spec.whatwg.org/#ref-for-count - auto label = vm.argument_count() ? TRY(vm.argument(0).to_string(vm)) : "default"; + auto label = vm.argument_count() ? TRY(vm.argument(0).to_deprecated_string(vm)) : "default"; // 1. Let map be the associated count map. auto& map = m_counters; @@ -151,7 +151,7 @@ ThrowCompletionOr<Value> Console::count_reset() auto& vm = realm().vm(); // NOTE: "default" is the default value in the IDL. https://console.spec.whatwg.org/#ref-for-countreset - auto label = vm.argument_count() ? TRY(vm.argument(0).to_string(vm)) : "default"; + auto label = vm.argument_count() ? TRY(vm.argument(0).to_deprecated_string(vm)) : "default"; // 1. Let map be the associated count map. auto& map = m_counters; @@ -212,7 +212,7 @@ ThrowCompletionOr<Value> Console::assert_() // 3. Otherwise: else { // 1. Let concat be the concatenation of message, U+003A (:), U+0020 SPACE, and first. - auto concat = PrimitiveString::create(vm, DeprecatedString::formatted("{}: {}", TRY(message->deprecated_string()), first.to_string(vm).value())); + auto concat = PrimitiveString::create(vm, DeprecatedString::formatted("{}: {}", TRY(message->deprecated_string()), first.to_deprecated_string(vm).value())); // 2. Set data[0] to concat. data[0] = concat; } @@ -312,7 +312,7 @@ ThrowCompletionOr<Value> Console::time() auto& vm = realm().vm(); // NOTE: "default" is the default value in the IDL. https://console.spec.whatwg.org/#ref-for-time - auto label = vm.argument_count() ? TRY(vm.argument(0).to_string(vm)) : "default"; + auto label = vm.argument_count() ? TRY(vm.argument(0).to_deprecated_string(vm)) : "default"; // 1. If the associated timer table contains an entry with key label, return, optionally reporting // a warning to the console indicating that a timer with label `label` has already been started. @@ -336,7 +336,7 @@ ThrowCompletionOr<Value> Console::time_log() auto& vm = realm().vm(); // NOTE: "default" is the default value in the IDL. https://console.spec.whatwg.org/#ref-for-timelog - auto label = vm.argument_count() ? TRY(vm.argument(0).to_string(vm)) : "default"; + auto label = vm.argument_count() ? TRY(vm.argument(0).to_deprecated_string(vm)) : "default"; // 1. Let timerTable be the associated timer table. @@ -379,7 +379,7 @@ ThrowCompletionOr<Value> Console::time_end() auto& vm = realm().vm(); // NOTE: "default" is the default value in the IDL. https://console.spec.whatwg.org/#ref-for-timeend - auto label = vm.argument_count() ? TRY(vm.argument(0).to_string(vm)) : "default"; + auto label = vm.argument_count() ? TRY(vm.argument(0).to_deprecated_string(vm)) : "default"; // 1. Let timerTable be the associated timer table. @@ -464,7 +464,7 @@ ThrowCompletionOr<DeprecatedString> Console::value_vector_to_deprecated_string(M for (auto const& item : values) { if (!builder.is_empty()) builder.append(' '); - builder.append(TRY(item.to_string(vm))); + builder.append(TRY(item.to_deprecated_string(vm))); } return builder.to_deprecated_string(); } @@ -539,7 +539,7 @@ ThrowCompletionOr<MarkedVector<Value>> ConsoleClient::formatter(MarkedVector<Val return args; // 2. Let target be the first element of args. - auto target = (!args.is_empty()) ? TRY(args.first().to_string(vm)) : ""; + auto target = (!args.is_empty()) ? TRY(args.first().to_deprecated_string(vm)) : ""; // 3. Let current be the second element of args. auto current = (args.size() > 1) ? args[1] : js_undefined(); @@ -621,13 +621,13 @@ ThrowCompletionOr<MarkedVector<Value>> ConsoleClient::formatter(MarkedVector<Val // 6. TODO: process %c else if (specifier == "%c"sv) { // NOTE: This has no spec yet. `%c` specifiers treat the argument as CSS styling for the log message. - add_css_style_to_current_message(TRY(current.to_string(vm))); + add_css_style_to_current_message(TRY(current.to_deprecated_string(vm))); converted = PrimitiveString::create(vm, ""); } // 7. If any of the previous steps set converted, replace specifier in target with converted. if (converted.has_value()) - target = target.replace(specifier, TRY(converted->to_string(vm)), ReplaceMode::FirstOnly); + target = target.replace(specifier, TRY(converted->to_deprecated_string(vm)), ReplaceMode::FirstOnly); } // 7. Let result be a list containing target together with the elements of args starting from the third onward. diff --git a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp index 4c7a2f9131..9fff14e5ad 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/$262Object.cpp @@ -80,7 +80,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::detach_array_buffer) JS_DEFINE_NATIVE_FUNCTION($262Object::eval_script) { - auto source_text = TRY(vm.argument(0).to_string(vm)); + auto source_text = TRY(vm.argument(0).to_deprecated_string(vm)); // 1. Let hostDefined be any host-defined values for the provided sourceText (obtained in an implementation dependent manner) diff --git a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp index 95d7c3867b..8dd7dca8d7 100644 --- a/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Contrib/Test262/GlobalObject.cpp @@ -34,7 +34,7 @@ void GlobalObject::visit_edges(Cell::Visitor& visitor) JS_DEFINE_NATIVE_FUNCTION(GlobalObject::print) { - auto string = TRY(vm.argument(0).to_string(vm)); + auto string = TRY(vm.argument(0).to_deprecated_string(vm)); outln("{}", string); return js_undefined(); } diff --git a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp index d70b0fa2db..540a2a567c 100644 --- a/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/AggregateErrorConstructor.cpp @@ -53,7 +53,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> AggregateErrorConstructor::construct(Fun // 3. If message is not undefined, then if (!message.is_undefined()) { // a. Let msg be ? ToString(message). - auto msg = TRY(message.to_string(vm)); + auto msg = TRY(message.to_deprecated_string(vm)); // b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). aggregate_error->create_non_enumerable_data_property_or_throw(vm.names.message, PrimitiveString::create(vm, msg)); diff --git a/Userland/Libraries/LibJS/Runtime/Array.cpp b/Userland/Libraries/LibJS/Runtime/Array.cpp index b651b31f1b..4bf4922556 100644 --- a/Userland/Libraries/LibJS/Runtime/Array.cpp +++ b/Userland/Libraries/LibJS/Runtime/Array.cpp @@ -186,10 +186,10 @@ ThrowCompletionOr<double> compare_array_elements(VM& vm, Value x, Value y, Funct } // 5. Let xString be ? ToString(x). - auto x_string = PrimitiveString::create(vm, TRY(x.to_string(vm))); + auto x_string = PrimitiveString::create(vm, TRY(x.to_deprecated_string(vm))); // 6. Let yString be ? ToString(y). - auto y_string = PrimitiveString::create(vm, TRY(y.to_string(vm))); + auto y_string = PrimitiveString::create(vm, TRY(y.to_deprecated_string(vm))); // 7. Let xSmaller be ! IsLessThan(xString, yString, true). auto x_smaller = MUST(is_less_than(vm, x_string, y_string, true)); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index 2d6426e134..3d97e89425 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -1000,7 +1000,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::join) auto length = TRY(length_of_array_like(vm, *this_object)); DeprecatedString separator = ","; if (!vm.argument(0).is_undefined()) - separator = TRY(vm.argument(0).to_string(vm)); + separator = TRY(vm.argument(0).to_deprecated_string(vm)); StringBuilder builder; for (size_t i = 0; i < length; ++i) { if (i > 0) @@ -1008,7 +1008,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::join) auto value = TRY(this_object->get(i)); if (value.is_nullish()) continue; - auto string = TRY(value.to_string(vm)); + auto string = TRY(value.to_deprecated_string(vm)); builder.append(string); } @@ -1735,7 +1735,7 @@ JS_DEFINE_NATIVE_FUNCTION(ArrayPrototype::to_locale_string) auto locale_string_result = TRY(value.invoke(vm, vm.names.toLocaleString, locales, options)); // ii. Set R to the string-concatenation of R and S. - auto string = TRY(locale_string_result.to_string(vm)); + auto string = TRY(locale_string_result.to_deprecated_string(vm)); builder.append(string); } diff --git a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp index fd1b843739..ace3ac4c3c 100644 --- a/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/DateConstructor.cpp @@ -316,7 +316,7 @@ JS_DEFINE_NATIVE_FUNCTION(DateConstructor::parse) if (!vm.argument_count()) return js_nan(); - auto date_string = TRY(vm.argument(0).to_string(vm)); + auto date_string = TRY(vm.argument(0).to_deprecated_string(vm)); return Value(parse_date_string(date_string)); } diff --git a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp index b2b10d1665..c553ffacd6 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorConstructor.cpp @@ -48,7 +48,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje // 3. If message is not undefined, then if (!message.is_undefined()) { // a. Let msg be ? ToString(message). - auto msg = TRY(message.to_string(vm)); + auto msg = TRY(message.to_deprecated_string(vm)); // b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). error->create_non_enumerable_data_property_or_throw(vm.names.message, PrimitiveString::create(vm, move(msg))); @@ -101,7 +101,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> ErrorConstructor::construct(FunctionObje /* 3. If message is not undefined, then */ \ if (!message.is_undefined()) { \ /* a. Let msg be ? ToString(message). */ \ - auto msg = TRY(message.to_string(vm)); \ + auto msg = TRY(message.to_deprecated_string(vm)); \ \ /* b. Perform CreateNonEnumerableDataPropertyOrThrow(O, "message", msg). */ \ error->create_non_enumerable_data_property_or_throw(vm.names.message, PrimitiveString::create(vm, move(msg))); \ diff --git a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp index 206e721b26..bf1c5bc3a1 100644 --- a/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ErrorPrototype.cpp @@ -46,7 +46,7 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::to_string) // 4. If name is undefined, set name to "Error"; otherwise set name to ? ToString(name). auto name = name_property.is_undefined() ? DeprecatedString { "Error"sv } - : TRY(name_property.to_string(vm)); + : TRY(name_property.to_deprecated_string(vm)); // 5. Let msg be ? Get(O, "message"). auto message_property = TRY(this_object->get(vm.names.message)); @@ -54,7 +54,7 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::to_string) // 6. If msg is undefined, set msg to the empty String; otherwise set msg to ? ToString(msg). auto message = message_property.is_undefined() ? DeprecatedString::empty() - : TRY(message_property.to_string(vm)); + : TRY(message_property.to_deprecated_string(vm)); // 7. If name is the empty String, return msg. if (name.is_empty()) @@ -87,12 +87,12 @@ JS_DEFINE_NATIVE_FUNCTION(ErrorPrototype::stack_getter) DeprecatedString name = "Error"; auto name_property = TRY(error.get(vm.names.name)); if (!name_property.is_undefined()) - name = TRY(name_property.to_string(vm)); + name = TRY(name_property.to_deprecated_string(vm)); DeprecatedString message = ""; auto message_property = TRY(error.get(vm.names.message)); if (!message_property.is_undefined()) - message = TRY(message_property.to_string(vm)); + message = TRY(message_property.to_deprecated_string(vm)); DeprecatedString header = name; if (!message.is_empty()) diff --git a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp index 1c3b6e6c2d..de2c897175 100644 --- a/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/FunctionConstructor.cpp @@ -145,7 +145,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> FunctionConstructor::create_dynamic // ii. Let nextArgString be ? ToString(nextArg). // iii. Set P to the string-concatenation of P, "," (a comma), and nextArgString. - parameters.append(TRY(next_arg.to_string(vm))); + parameters.append(TRY(next_arg.to_deprecated_string(vm))); // iv. Set k to k + 1. } @@ -156,7 +156,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> FunctionConstructor::create_dynamic } // 13. Let bodyString be the string-concatenation of 0x000A (LINE FEED), ? ToString(bodyArg), and 0x000A (LINE FEED). - auto body_string = DeprecatedString::formatted("\n{}\n", body_arg.has_value() ? TRY(body_arg->to_string(vm)) : ""); + auto body_string = DeprecatedString::formatted("\n{}\n", body_arg.has_value() ? TRY(body_arg->to_deprecated_string(vm)) : ""); // 14. Let sourceString be the string-concatenation of prefix, " anonymous(", P, 0x000A (LINE FEED), ") {", bodyString, and "}". // 15. Let sourceText be StringToCodePoints(sourceString). diff --git a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp index 6016118c40..216a383aef 100644 --- a/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/GlobalObject.cpp @@ -225,7 +225,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::parse_float) { if (vm.argument(0).is_number()) return vm.argument(0); - auto input_string = TRY(vm.argument(0).to_string(vm)); + auto input_string = TRY(vm.argument(0).to_deprecated_string(vm)); auto trimmed_string = MUST(trim_string(vm, PrimitiveString::create(vm, input_string), TrimMode::Left)); if (trimmed_string.is_empty()) return js_nan(); @@ -250,7 +250,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::parse_float) JS_DEFINE_NATIVE_FUNCTION(GlobalObject::parse_int) { // 1. Let inputString be ? ToString(string). - auto input_string = TRY(vm.argument(0).to_string(vm)); + auto input_string = TRY(vm.argument(0).to_deprecated_string(vm)); // 2. Let S be ! TrimString(inputString, start). auto string = MUST(trim_string(vm, PrimitiveString::create(vm, input_string), TrimMode::Left)); @@ -456,7 +456,7 @@ static ThrowCompletionOr<DeprecatedString> decode(VM& vm, DeprecatedString const // 19.2.6.4 encodeURI ( uri ), https://tc39.es/ecma262/#sec-encodeuri-uri JS_DEFINE_NATIVE_FUNCTION(GlobalObject::encode_uri) { - auto uri_string = TRY(vm.argument(0).to_string(vm)); + auto uri_string = TRY(vm.argument(0).to_deprecated_string(vm)); auto encoded = TRY(encode(vm, uri_string, ";/?:@&=+$,abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()#"sv)); return PrimitiveString::create(vm, move(encoded)); } @@ -464,7 +464,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::encode_uri) // 19.2.6.2 decodeURI ( encodedURI ), https://tc39.es/ecma262/#sec-decodeuri-encodeduri JS_DEFINE_NATIVE_FUNCTION(GlobalObject::decode_uri) { - auto uri_string = TRY(vm.argument(0).to_string(vm)); + auto uri_string = TRY(vm.argument(0).to_deprecated_string(vm)); auto decoded = TRY(decode(vm, uri_string, ";/?:@&=+$,#"sv)); return PrimitiveString::create(vm, move(decoded)); } @@ -472,7 +472,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::decode_uri) // 19.2.6.5 encodeURIComponent ( uriComponent ), https://tc39.es/ecma262/#sec-encodeuricomponent-uricomponent JS_DEFINE_NATIVE_FUNCTION(GlobalObject::encode_uri_component) { - auto uri_string = TRY(vm.argument(0).to_string(vm)); + auto uri_string = TRY(vm.argument(0).to_deprecated_string(vm)); auto encoded = TRY(encode(vm, uri_string, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.!~*'()"sv)); return PrimitiveString::create(vm, move(encoded)); } @@ -480,7 +480,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::encode_uri_component) // 19.2.6.3 decodeURIComponent ( encodedURIComponent ), https://tc39.es/ecma262/#sec-decodeuricomponent-encodeduricomponent JS_DEFINE_NATIVE_FUNCTION(GlobalObject::decode_uri_component) { - auto uri_string = TRY(vm.argument(0).to_string(vm)); + auto uri_string = TRY(vm.argument(0).to_deprecated_string(vm)); auto decoded = TRY(decode(vm, uri_string, ""sv)); return PrimitiveString::create(vm, move(decoded)); } @@ -488,7 +488,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::decode_uri_component) // B.2.1.1 escape ( string ), https://tc39.es/ecma262/#sec-escape-string JS_DEFINE_NATIVE_FUNCTION(GlobalObject::escape) { - auto string = TRY(vm.argument(0).to_string(vm)); + auto string = TRY(vm.argument(0).to_deprecated_string(vm)); StringBuilder escaped; for (auto code_point : TRY_OR_THROW_OOM(vm, utf8_to_utf16(string))) { if (code_point < 256) { @@ -506,7 +506,7 @@ JS_DEFINE_NATIVE_FUNCTION(GlobalObject::escape) // B.2.1.2 unescape ( string ), https://tc39.es/ecma262/#sec-unescape-string JS_DEFINE_NATIVE_FUNCTION(GlobalObject::unescape) { - auto string = TRY(vm.argument(0).to_string(vm)); + auto string = TRY(vm.argument(0).to_deprecated_string(vm)); ssize_t length = string.length(); StringBuilder unescaped(length); for (auto k = 0; k < length; ++k) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp index 2248532467..33112fc658 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/AbstractOperations.cpp @@ -240,7 +240,7 @@ ThrowCompletionOr<Vector<DeprecatedString>> canonicalize_locale_list(VM& vm, Val // iv. Else, else { // 1. Let tag be ? ToString(kValue). - tag = TRY(key_value.to_string(vm)); + tag = TRY(key_value.to_deprecated_string(vm)); } // v. If ! IsStructurallyValidLanguageTag(tag) is false, throw a RangeError exception. @@ -628,7 +628,7 @@ ThrowCompletionOr<StringOrBoolean> get_string_or_boolean_option(VM& vm, Object c return falsy_value; // 6. Let value be ? ToString(value). - auto value_string = TRY(value.to_string(vm)); + auto value_string = TRY(value.to_deprecated_string(vm)); // 7. NOTE: For historical reasons, the strings "true" and "false" are treated the same as the boolean value true. // 8. If value is "true" or "false", return fallback. diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp index a12ce9ced6..c5a43d660b 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorCompareFunction.cpp @@ -58,9 +58,9 @@ ThrowCompletionOr<Value> CollatorCompareFunction::call() // 4. If y is not provided, let y be undefined. // 5. Let X be ? ToString(x). - auto x = TRY(vm.argument(0).to_string(vm)); + auto x = TRY(vm.argument(0).to_deprecated_string(vm)); // 6. Let Y be ? ToString(y). - auto y = TRY(vm.argument(1).to_string(vm)); + auto y = TRY(vm.argument(1).to_deprecated_string(vm)); // 7. Return CompareStrings(collator, X, Y). return compare_strings(m_collator, Utf8View(x), Utf8View(y)); diff --git a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp index 0a1e4b8b9b..37266a1fdb 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/CollatorConstructor.cpp @@ -63,7 +63,7 @@ static ThrowCompletionOr<Collator*> initialize_collator(VM& vm, Collator& collat // a. Let numeric be ! ToString(numeric). // 15. Set opt.[[kn]] to numeric. if (!numeric.is_undefined()) - opt.kn = MUST(numeric.to_string(vm)); + opt.kn = MUST(numeric.to_deprecated_string(vm)); // 16. Let caseFirst be ? GetOption(options, "caseFirst", string, « "upper", "lower", "false" », undefined). // 17. Set opt.[[kf]] to caseFirst. diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp index 966323ba70..8b1e31cc59 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DateTimeFormatConstructor.cpp @@ -224,7 +224,7 @@ ThrowCompletionOr<DateTimeFormat*> initialize_date_time_format(VM& vm, DateTimeF // 31. Else, else { // a. Set timeZone to ? ToString(timeZone). - time_zone = TRY(time_zone_value.to_string(vm)); + time_zone = TRY(time_zone_value.to_deprecated_string(vm)); // b. If IsAvailableTimeZoneName(timeZone) is false, then if (!Temporal::is_available_time_zone_name(time_zone)) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp index 2ad69c9abf..f74b56ea99 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/DisplayNamesPrototype.cpp @@ -43,7 +43,7 @@ JS_DEFINE_NATIVE_FUNCTION(DisplayNamesPrototype::of) auto* display_names = TRY(typed_this_object(vm)); // 3. Let code be ? ToString(code). - auto code_string = TRY(code.to_string(vm)); + auto code_string = TRY(code.to_deprecated_string(vm)); code = PrimitiveString::create(vm, move(code_string)); // 4. Let code be ? CanonicalCodeForDisplayNames(displayNames.[[Type]], code). diff --git a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp index b9787f157e..228a44e980 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/Intl.cpp @@ -111,7 +111,7 @@ JS_DEFINE_NATIVE_FUNCTION(Intl::supported_values_of) auto& realm = *vm.current_realm(); // 1. Let key be ? ToString(key). - auto key = TRY(vm.argument(0).to_string(vm)); + auto key = TRY(vm.argument(0).to_deprecated_string(vm)); Span<StringView const> list; diff --git a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp index dfdda72eb4..be16b88191 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/LocaleConstructor.cpp @@ -275,7 +275,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> LocaleConstructor::construct(FunctionObj // 9. Else, else { // a. Let tag be ? ToString(tag). - tag = TRY(tag_value.to_string(vm)); + tag = TRY(tag_value.to_deprecated_string(vm)); } // 10. Set options to ? CoerceOptionsToObject(options). @@ -313,7 +313,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> LocaleConstructor::construct(FunctionObj // 24. If kn is not undefined, set kn to ! ToString(kn). // 25. Set opt.[[kn]] to kn. if (!kn.is_undefined()) - opt.kn = TRY(kn.to_string(vm)); + opt.kn = TRY(kn.to_deprecated_string(vm)); // 26. Let numberingSystem be ? GetOption(options, "numberingSystem", string, empty, undefined). // 27. If numberingSystem is not undefined, then diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp index 1dce1620b0..cf03c028b0 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormat.cpp @@ -141,7 +141,7 @@ ThrowCompletionOr<Vector<PatternPartitionWithUnit>> partition_relative_time_patt // 16. If numeric is equal to "auto", then if (relative_time_format.numeric() == RelativeTimeFormat::Numeric::Auto) { // a. Let valueString be ToString(value). - auto value_string = MUST(Value(value).to_string(vm)); + auto value_string = MUST(Value(value).to_deprecated_string(vm)); // b. If patterns has a field [[<valueString>]], then if (auto patterns = find_patterns_for_tense_or_number(value_string); !patterns.is_empty()) { diff --git a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp index 13f937f338..1dc8bfc32d 100644 --- a/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Intl/RelativeTimeFormatPrototype.cpp @@ -42,7 +42,7 @@ JS_DEFINE_NATIVE_FUNCTION(RelativeTimeFormatPrototype::format) auto value = TRY(vm.argument(0).to_number(vm)); // 4. Let unit be ? ToString(unit). - auto unit = TRY(vm.argument(1).to_string(vm)); + auto unit = TRY(vm.argument(1).to_deprecated_string(vm)); // 5. Return ? FormatRelativeTime(relativeTimeFormat, value, unit). auto formatted = TRY(format_relative_time(vm, *relative_time_format, value.as_double(), unit)); @@ -60,7 +60,7 @@ JS_DEFINE_NATIVE_FUNCTION(RelativeTimeFormatPrototype::format_to_parts) auto value = TRY(vm.argument(0).to_number(vm)); // 4. Let unit be ? ToString(unit). - auto unit = TRY(vm.argument(1).to_string(vm)); + auto unit = TRY(vm.argument(1).to_deprecated_string(vm)); // 5. Return ? FormatRelativeTimeToParts(relativeTimeFormat, value, unit). return TRY(format_relative_time_to_parts(vm, *relative_time_format, value.as_double(), unit)); diff --git a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp index 530b1dac2b..7978a44ba7 100644 --- a/Userland/Libraries/LibJS/Runtime/JSONObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/JSONObject.cpp @@ -65,11 +65,11 @@ ThrowCompletionOr<DeprecatedString> JSONObject::stringify_impl(VM& vm, Value val if (replacer_value.is_string()) { item = TRY(replacer_value.as_string().deprecated_string()); } else if (replacer_value.is_number()) { - item = MUST(replacer_value.to_string(vm)); + item = MUST(replacer_value.to_deprecated_string(vm)); } else if (replacer_value.is_object()) { auto& value_object = replacer_value.as_object(); if (is<StringObject>(value_object) || is<NumberObject>(value_object)) - item = TRY(replacer_value.to_string(vm)); + item = TRY(replacer_value.to_deprecated_string(vm)); } if (!item.is_null() && !list.contains_slow(item)) { list.append(item); @@ -191,7 +191,7 @@ ThrowCompletionOr<DeprecatedString> JSONObject::serialize_json_property(VM& vm, if (value.is_number()) { // a. If value is finite, return ! ToString(value). if (value.is_finite_number()) - return MUST(value.to_string(vm)); + return MUST(value.to_deprecated_string(vm)); // b. Return "null". return "null"sv; @@ -393,7 +393,7 @@ JS_DEFINE_NATIVE_FUNCTION(JSONObject::parse) { auto& realm = *vm.current_realm(); - auto string = TRY(vm.argument(0).to_string(vm)); + auto string = TRY(vm.argument(0).to_deprecated_string(vm)); auto reviver = vm.argument(1); auto json = JsonValue::from_string(string); diff --git a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp index ff8df13077..2776a40012 100644 --- a/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/NumberPrototype.cpp @@ -90,7 +90,7 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_exponential) // 4. If x is not finite, return Number::toString(x). if (!number_value.is_finite_number()) - return PrimitiveString::create(vm, MUST(number_value.to_string(vm))); + return PrimitiveString::create(vm, MUST(number_value.to_deprecated_string(vm))); // 5. If f < 0 or f > 100, throw a RangeError exception. if (fraction_digits < 0 || fraction_digits > 100) @@ -218,7 +218,7 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_fixed) // 6. If x is not finite, return Number::toString(x). if (!number_value.is_finite_number()) - return PrimitiveString::create(vm, TRY(number_value.to_string(vm))); + return PrimitiveString::create(vm, TRY(number_value.to_deprecated_string(vm))); // 7. Set x to ℝ(x). auto number = number_value.as_double(); @@ -233,7 +233,7 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_fixed) // 10. If x ≥ 10^21, then if (fabs(number) >= 1e+21) - return PrimitiveString::create(vm, MUST(number_value.to_string(vm))); + return PrimitiveString::create(vm, MUST(number_value.to_deprecated_string(vm))); // 11. Else, // a. Let n be an integer for which n / (10^f) - x is as close to zero as possible. If there are two such n, pick the larger n. @@ -302,14 +302,14 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_precision) // 2. If precision is undefined, return ! ToString(x). if (precision_value.is_undefined()) - return PrimitiveString::create(vm, MUST(number_value.to_string(vm))); + return PrimitiveString::create(vm, MUST(number_value.to_deprecated_string(vm))); // 3. Let p be ? ToIntegerOrInfinity(precision). auto precision = TRY(precision_value.to_integer_or_infinity(vm)); // 4. If x is not finite, return Number::toString(x). if (!number_value.is_finite_number()) - return PrimitiveString::create(vm, MUST(number_value.to_string(vm))); + return PrimitiveString::create(vm, MUST(number_value.to_deprecated_string(vm))); // 5. If p < 1 or p > 100, throw a RangeError exception. if ((precision < 1) || (precision > 100)) @@ -441,7 +441,7 @@ JS_DEFINE_NATIVE_FUNCTION(NumberPrototype::to_string) // 5. If radixMV = 10, return ! ToString(x). if (radix_mv == 10) - return PrimitiveString::create(vm, MUST(number_value.to_string(vm))); + return PrimitiveString::create(vm, MUST(number_value.to_deprecated_string(vm))); // 6. Return the String representation of this Number value using the radix specified by radixMV. Letters a-z are used for digits with values 10 through 35. The precise algorithm is implementation-defined, however the algorithm should be a generalization of that specified in 6.1.6.1.20. if (number_value.is_positive_infinity()) diff --git a/Userland/Libraries/LibJS/Runtime/PropertyKey.h b/Userland/Libraries/LibJS/Runtime/PropertyKey.h index e88bbb1e90..0cd8f3f28c 100644 --- a/Userland/Libraries/LibJS/Runtime/PropertyKey.h +++ b/Userland/Libraries/LibJS/Runtime/PropertyKey.h @@ -35,7 +35,7 @@ public: return PropertyKey { value.as_symbol() }; if (value.is_integral_number() && value.as_double() >= 0 && value.as_double() < NumericLimits<u32>::max()) return static_cast<u32>(value.as_double()); - return TRY(value.to_string(vm)); + return TRY(value.to_deprecated_string(vm)); } PropertyKey() = default; diff --git a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp index b9746af464..d612c0e48e 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpObject.cpp @@ -169,13 +169,13 @@ ThrowCompletionOr<NonnullGCPtr<RegExpObject>> RegExpObject::regexp_initialize(VM // 2. Else, let P be ? ToString(pattern). auto pattern = pattern_value.is_undefined() ? DeprecatedString::empty() - : TRY(pattern_value.to_string(vm)); + : TRY(pattern_value.to_deprecated_string(vm)); // 3. If flags is undefined, let F be the empty String. // 4. Else, let F be ? ToString(flags). auto flags = flags_value.is_undefined() ? DeprecatedString::empty() - : TRY(flags_value.to_string(vm)); + : TRY(flags_value.to_deprecated_string(vm)); // 5. If F contains any code unit other than "d", "g", "i", "m", "s", "u", or "y" or if it contains the same code unit more than once, throw a SyntaxError exception. // 6. If F contains "i", let i be true; else let i be false. diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index e1dd4cb73b..6a9b0c8247 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -528,7 +528,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_match) // 4. Let flags be ? ToString(? Get(rx, "flags")). auto flags_value = TRY(regexp_object->get(vm.names.flags)); - auto flags = TRY(flags_value.to_string(vm)); + auto flags = TRY(flags_value.to_deprecated_string(vm)); // 5. If flags does not contain "g", then if (!flags.contains('g')) { @@ -573,7 +573,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_match) // 1. Let matchStr be ? ToString(? Get(result, "0")). auto match_value = TRY(result.get(0)); - auto match_str = TRY(match_value.to_string(vm)); + auto match_str = TRY(match_value.to_deprecated_string(vm)); // 2. Perform ! CreateDataPropertyOrThrow(A, ! ToString(𝔽(n)), matchStr). MUST(array->create_data_property_or_throw(n, PrimitiveString::create(vm, match_str))); @@ -607,7 +607,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_match_all) // 5. Let flags be ? ToString(? Get(R, "flags")). auto flags_value = TRY(regexp_object->get(vm.names.flags)); - auto flags = TRY(flags_value.to_string(vm)); + auto flags = TRY(flags_value.to_deprecated_string(vm)); // Steps 9-12 are performed early so that flags can be moved. @@ -653,13 +653,13 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) // 6. If functionalReplace is false, then if (!replace_value.is_function()) { // a. Set replaceValue to ? ToString(replaceValue). - auto replace_string = TRY(replace_value.to_string(vm)); + auto replace_string = TRY(replace_value.to_deprecated_string(vm)); replace_value = PrimitiveString::create(vm, move(replace_string)); } // 7. Let flags be ? ToString(? Get(rx, "flags")). auto flags_value = TRY(regexp_object->get(vm.names.flags)); - auto flags = TRY(flags_value.to_string(vm)); + auto flags = TRY(flags_value.to_deprecated_string(vm)); // 8. If flags contains "g", let global be true. Otherwise, let global be false. bool global = flags.contains('g'); @@ -702,7 +702,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) // 1. Let matchStr be ? ToString(? Get(result, "0")). auto match_value = TRY(result.get(vm, 0)); - auto match_str = TRY(match_value.to_string(vm)); + auto match_str = TRY(match_value.to_deprecated_string(vm)); // 2. If matchStr is the empty String, then if (match_str.is_empty()) { @@ -752,7 +752,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) // ii. If capN is not undefined, then if (!capture.is_undefined()) { // 1. Set capN to ? ToString(capN). - capture = PrimitiveString::create(vm, TRY(capture.to_string(vm))); + capture = PrimitiveString::create(vm, TRY(capture.to_deprecated_string(vm))); } // iii. Append capN as the last element of captures. @@ -790,7 +790,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_replace) auto replace_result = TRY(call(vm, replace_value.as_function(), js_undefined(), move(replacer_args))); // vi. Let replacement be ? ToString(replValue). - replacement = TRY(replace_result.to_string(vm)); + replacement = TRY(replace_result.to_deprecated_string(vm)); } // l. Else, else { @@ -912,7 +912,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::symbol_split) // 5. Let flags be ? ToString(? Get(rx, "flags")). auto flags_value = TRY(regexp_object->get(vm.names.flags)); - auto flags = TRY(flags_value.to_string(vm)); + auto flags = TRY(flags_value.to_deprecated_string(vm)); // 6. If flags contains "u" or flags contains "v", let unicodeMatching be true. // 7. Else, let unicodeMatching be false. @@ -1077,11 +1077,11 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpPrototype::to_string) // 3. Let pattern be ? ToString(? Get(R, "source")). auto source_attr = TRY(regexp_object->get(vm.names.source)); - auto pattern = TRY(source_attr.to_string(vm)); + auto pattern = TRY(source_attr.to_deprecated_string(vm)); // 4. Let flags be ? ToString(? Get(R, "flags")). auto flags_attr = TRY(regexp_object->get(vm.names.flags)); - auto flags = TRY(flags_attr.to_string(vm)); + auto flags = TRY(flags_attr.to_deprecated_string(vm)); // 5. Let result be the string-concatenation of "/", pattern, "/", and flags. // 6. Return result. diff --git a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp index db5976216f..87f865d155 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpStringIteratorPrototype.cpp @@ -51,7 +51,7 @@ JS_DEFINE_NATIVE_FUNCTION(RegExpStringIteratorPrototype::next) auto* match_object = TRY(match.to_object(vm)); auto match_string_value = TRY(match_object->get(0)); - auto match_string = TRY(match_string_value.to_string(vm)); + auto match_string = TRY(match_string_value.to_deprecated_string(vm)); if (match_string.is_empty()) { auto last_index_value = TRY(iterator->regexp_object().get(vm.names.lastIndex)); auto last_index = TRY(last_index_value.to_length(vm)); diff --git a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp index 30fe1b21d3..adce5d73ee 100644 --- a/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ShadowRealmPrototype.cpp @@ -63,7 +63,7 @@ JS_DEFINE_NATIVE_FUNCTION(ShadowRealmPrototype::import_value) auto* object = TRY(typed_this_object(vm)); // 3. Let specifierString be ? ToString(specifier). - auto specifier_string = TRY(specifier.to_string(vm)); + auto specifier_string = TRY(specifier.to_deprecated_string(vm)); // 4. If Type(exportName) is not String, throw a TypeError exception. if (!export_name.is_string()) diff --git a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp index 6964cb28dc..ab8e4d5745 100644 --- a/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringConstructor.cpp @@ -81,7 +81,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw) for (size_t i = 0; i < literal_segments; ++i) { auto next_key = DeprecatedString::number(i); auto next_segment_value = TRY(raw->get(next_key)); - auto next_segment = TRY(next_segment_value.to_string(vm)); + auto next_segment = TRY(next_segment_value.to_deprecated_string(vm)); builder.append(next_segment); @@ -90,7 +90,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringConstructor::raw) if (i < number_of_substituions) { auto next = vm.argument(i + 1); - auto next_sub = TRY(next.to_string(vm)); + auto next_sub = TRY(next.to_deprecated_string(vm)); builder.append(next_sub); } } diff --git a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp index cfc260e331..7d009e5263 100644 --- a/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/StringPrototype.cpp @@ -37,7 +37,7 @@ namespace JS { static ThrowCompletionOr<DeprecatedString> ak_string_from(VM& vm) { auto this_value = TRY(require_object_coercible(vm, vm.this_value())); - return TRY(this_value.to_string(vm)); + return TRY(this_value.to_deprecated_string(vm)); } static ThrowCompletionOr<Utf16String> utf16_string_from(VM& vm) @@ -427,10 +427,10 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::locale_compare) auto object = TRY(require_object_coercible(vm, vm.this_value())); // 2. Let S be ? ToString(O). - auto string = TRY(object.to_string(vm)); + auto string = TRY(object.to_deprecated_string(vm)); // 3. Let thatValue be ? ToString(that). - auto that_value = TRY(vm.argument(0).to_string(vm)); + auto that_value = TRY(vm.argument(0).to_deprecated_string(vm)); // 4. Let collator be ? Construct(%Collator%, « locales, options »). auto collator = TRY(construct(vm, *realm.intrinsics().intl_collator_constructor(), vm.argument(1), vm.argument(2))); @@ -465,7 +465,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::match_all) if (is_regexp) { auto flags = TRY(regexp.as_object().get("flags")); auto flags_object = TRY(require_object_coercible(vm, flags)); - auto flags_string = TRY(flags_object.to_string(vm)); + auto flags_string = TRY(flags_object.to_deprecated_string(vm)); if (!flags_string.contains('g')) return vm.throw_completion<TypeError>(ErrorType::StringNonGlobalRegExp); } @@ -491,7 +491,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::normalize) DeprecatedString form = "NFC"; auto form_value = vm.argument(0); if (!form_value.is_undefined()) - form = TRY(form_value.to_string(vm)); + form = TRY(form_value.to_deprecated_string(vm)); // 5. If f is not one of "NFC", "NFD", "NFKC", or "NFKD", throw a RangeError exception. if (!form.is_one_of("NFC"sv, "NFD"sv, "NFKC"sv, "NFKD"sv)) @@ -611,7 +611,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace) if (replace_value.is_function()) { auto result = TRY(call(vm, replace_value.as_function(), js_undefined(), PrimitiveString::create(vm, search_string), Value(position.value()), PrimitiveString::create(vm, string))); - replacement = TRY(result.to_string(vm)); + replacement = TRY(result.to_deprecated_string(vm)); } else { replacement = TRY(get_substitution(vm, search_string.view(), string.view(), *position, {}, js_undefined(), replace_value)); } @@ -637,7 +637,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace_all) if (is_regexp) { auto flags = TRY(search_value.as_object().get(vm.names.flags)); auto flags_object = TRY(require_object_coercible(vm, flags)); - auto flags_string = TRY(flags_object.to_string(vm)); + auto flags_string = TRY(flags_object.to_deprecated_string(vm)); if (!flags_string.contains('g')) return vm.throw_completion<TypeError>(ErrorType::StringNonGlobalRegExp); } @@ -676,7 +676,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::replace_all) if (replace_value.is_function()) { auto result = TRY(call(vm, replace_value.as_function(), js_undefined(), PrimitiveString::create(vm, search_string), Value(position), PrimitiveString::create(vm, string))); - replacement = TRY(result.to_string(vm)); + replacement = TRY(result.to_deprecated_string(vm)); } else { replacement = TRY(get_substitution(vm, search_string.view(), string.view(), position, {}, js_undefined(), replace_value)); } @@ -1028,7 +1028,7 @@ ThrowCompletionOr<DeprecatedString> trim_string(VM& vm, Value input_value, TrimM auto input_string = TRY(require_object_coercible(vm, input_value)); // 2. Let S be ? ToString(str). - auto string = TRY(input_string.to_string(vm)); + auto string = TRY(input_string.to_deprecated_string(vm)); // 3. If where is start, let T be the String value that is a copy of S with leading white space removed. // 4. Else if where is end, let T be the String value that is a copy of S with trailing white space removed. @@ -1071,7 +1071,7 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::symbol_iterator) auto& realm = *vm.current_realm(); auto this_object = TRY(require_object_coercible(vm, vm.this_value())); - auto string = TRY(this_object.to_string(vm)); + auto string = TRY(this_object.to_deprecated_string(vm)); return StringIterator::create(realm, string); } @@ -1119,12 +1119,12 @@ JS_DEFINE_NATIVE_FUNCTION(StringPrototype::substr) static ThrowCompletionOr<Value> create_html(VM& vm, Value string, DeprecatedString const& tag, DeprecatedString const& attribute, Value value) { TRY(require_object_coercible(vm, string)); - auto str = TRY(string.to_string(vm)); + auto str = TRY(string.to_deprecated_string(vm)); ThrowableStringBuilder builder(vm); TRY(builder.append('<')); TRY(builder.append(tag)); if (!attribute.is_empty()) { - auto value_string = TRY(value.to_string(vm)); + auto value_string = TRY(value.to_deprecated_string(vm)); TRY(builder.append(' ')); TRY(builder.append(attribute)); TRY(builder.append("=\""sv)); diff --git a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp index cca758dac3..c8a7843c5e 100644 --- a/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/SymbolConstructor.cpp @@ -42,7 +42,7 @@ ThrowCompletionOr<Value> SymbolConstructor::call() auto& vm = this->vm(); if (vm.argument(0).is_undefined()) return Symbol::create(vm, {}, false); - return Symbol::create(vm, TRY(vm.argument(0).to_string(vm)), false); + return Symbol::create(vm, TRY(vm.argument(0).to_deprecated_string(vm)), false); } // 20.4.1.1 Symbol ( [ description ] ), https://tc39.es/ecma262/#sec-symbol-description @@ -55,7 +55,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> SymbolConstructor::construct(FunctionObj JS_DEFINE_NATIVE_FUNCTION(SymbolConstructor::for_) { // 1. Let stringKey be ? ToString(key). - auto string_key = TRY(vm.argument(0).to_string(vm)); + auto string_key = TRY(vm.argument(0).to_deprecated_string(vm)); // 2. For each element e of the GlobalSymbolRegistry List, do auto result = vm.global_symbol_registry().get(string_key); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp index c69c947610..168685c06c 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/AbstractOperations.cpp @@ -390,7 +390,7 @@ ThrowCompletionOr<SecondsStringPrecision> to_seconds_string_precision(VM& vm, Ob // a. If fractionalDigitsVal is not undefined, then if (!fractional_digits_value.is_undefined()) { // i. If ? ToString(fractionalDigitsVal) is not "auto", throw a RangeError exception. - if (TRY(fractional_digits_value.to_string(vm)) != "auto"sv) + if (TRY(fractional_digits_value.to_deprecated_string(vm)) != "auto"sv) return vm.template throw_completion<RangeError>(ErrorType::OptionIsNotValidValue, fractional_digits_value, "fractionalSecondDigits"sv); } @@ -628,7 +628,7 @@ ThrowCompletionOr<Value> to_relative_temporal_object(VM& vm, Object const& optio // 7. Else, else { // a. Let string be ? ToString(value). - auto string = TRY(value.to_string(vm)); + auto string = TRY(value.to_deprecated_string(vm)); // b. Let result be ? ParseTemporalRelativeToString(string). result = TRY(parse_temporal_relative_to_string(vm, string)); @@ -690,7 +690,7 @@ ThrowCompletionOr<Value> to_relative_temporal_object(VM& vm, Object const& optio if (offset_behavior == OffsetBehavior::Option) { // a. Set offsetString to ? ToString(offsetString). // NOTE: offsetString is not used after this path, so we don't need to put this into the original offset_string which is of type JS::Value. - auto actual_offset_string = TRY(offset_string.to_string(vm)); + auto actual_offset_string = TRY(offset_string.to_deprecated_string(vm)); // b. If IsTimeZoneOffsetString(offsetString) is false, throw a RangeError exception. if (!is_time_zone_offset_string(actual_offset_string)) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp index 3922263ae3..a2d38d25a4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Calendar.cpp @@ -238,7 +238,7 @@ ThrowCompletionOr<DeprecatedString> calendar_month_code(VM& vm, Object& calendar return vm.throw_completion<RangeError>(ErrorType::TemporalInvalidCalendarFunctionResult, vm.names.monthCode.as_string(), vm.names.undefined.as_string()); // 3. Return ? ToString(result). - return result.to_string(vm); + return result.to_deprecated_string(vm); } // 12.2.11 CalendarDay ( calendar, dateLike ), https://tc39.es/proposal-temporal/#sec-temporal-calendarday @@ -387,7 +387,7 @@ ThrowCompletionOr<Value> calendar_era(VM& vm, Object& calendar, Object& date_lik // 3. If result is not undefined, set result to ? ToString(result). if (!result.is_undefined()) - result = PrimitiveString::create(vm, TRY(result.to_string(vm))); + result = PrimitiveString::create(vm, TRY(result.to_deprecated_string(vm))); // 4. Return result. return result; @@ -461,7 +461,7 @@ ThrowCompletionOr<Object*> to_temporal_calendar(VM& vm, Value temporal_calendar_ } // 2. Let identifier be ? ToString(temporalCalendarLike). - auto identifier = TRY(temporal_calendar_like.to_string(vm)); + auto identifier = TRY(temporal_calendar_like.to_deprecated_string(vm)); // 3. Set identifier to ? ParseTemporalCalendarString(identifier). identifier = TRY(parse_temporal_calendar_string(vm, identifier)); @@ -573,7 +573,7 @@ ThrowCompletionOr<DeprecatedString> maybe_format_calendar_annotation(VM& vm, Obj VERIFY(calendar_object); // 3. Let calendarID be ? ToString(calendarObject). - auto calendar_id = TRY(Value(calendar_object).to_string(vm)); + auto calendar_id = TRY(Value(calendar_object).to_deprecated_string(vm)); // 4. Return FormatCalendarAnnotation(calendarID, showCalendar). return format_calendar_annotation(calendar_id, show_calendar); @@ -607,10 +607,10 @@ ThrowCompletionOr<bool> calendar_equals(VM& vm, Object& one, Object& two) return true; // 2. Let calendarOne be ? ToString(one). - auto calendar_one = TRY(Value(&one).to_string(vm)); + auto calendar_one = TRY(Value(&one).to_deprecated_string(vm)); // 3. Let calendarTwo be ? ToString(two). - auto calendar_two = TRY(Value(&two).to_string(vm)); + auto calendar_two = TRY(Value(&two).to_deprecated_string(vm)); // 4. If calendarOne is calendarTwo, return true. if (calendar_one == calendar_two) @@ -628,10 +628,10 @@ ThrowCompletionOr<Object*> consolidate_calendars(VM& vm, Object& one, Object& tw return &two; // 2. Let calendarOne be ? ToString(one). - auto calendar_one = TRY(Value(&one).to_string(vm)); + auto calendar_one = TRY(Value(&one).to_deprecated_string(vm)); // 3. Let calendarTwo be ? ToString(two). - auto calendar_two = TRY(Value(&two).to_string(vm)); + auto calendar_two = TRY(Value(&two).to_deprecated_string(vm)); // 4. If calendarOne is calendarTwo, return two. if (calendar_one == calendar_two) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp index 61ccc8ce31..1a03ae7c0f 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarConstructor.cpp @@ -47,7 +47,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> CalendarConstructor::construct(FunctionO auto& vm = this->vm(); // 2. Set id to ? ToString(id). - auto identifier = TRY(vm.argument(0).to_string(vm)); + auto identifier = TRY(vm.argument(0).to_deprecated_string(vm)); // 3. If IsBuiltinCalendar(id) is false, then if (!is_builtin_calendar(identifier)) { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp index 886c058e32..cedae24bb4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/CalendarPrototype.cpp @@ -627,7 +627,7 @@ JS_DEFINE_NATIVE_FUNCTION(CalendarPrototype::to_json) auto* calendar = TRY(typed_this_object(vm)); // 3. Return ? ToString(calendar). - return PrimitiveString::create(vm, TRY(Value(calendar).to_string(vm))); + return PrimitiveString::create(vm, TRY(Value(calendar).to_deprecated_string(vm))); } // 15.6.2.6 Temporal.Calendar.prototype.era ( temporalDateLike ), https://tc39.es/proposal-temporal/#sec-temporal.calendar.prototype.era diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp index 648320da1a..0141ea1986 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Duration.cpp @@ -143,7 +143,7 @@ ThrowCompletionOr<DurationRecord> to_temporal_duration_record(VM& vm, Value temp // 1. If Type(temporalDurationLike) is not Object, then if (!temporal_duration_like.is_object()) { // a. Let string be ? ToString(temporalDurationLike). - auto string = TRY(temporal_duration_like.to_string(vm)); + auto string = TRY(temporal_duration_like.to_deprecated_string(vm)); // b. Return ? ParseTemporalDurationString(string). return parse_temporal_duration_string(vm, string); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp index 52b510bdd2..32667e2bfe 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.cpp @@ -100,7 +100,7 @@ ThrowCompletionOr<Instant*> to_temporal_instant(VM& vm, Value item) } // 2. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // 3. Let epochNanoseconds be ? ParseTemporalInstant(string). auto* epoch_nanoseconds = TRY(parse_temporal_instant(vm, string)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp index 3ab032b6cf..a72c59f637 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDate.cpp @@ -140,7 +140,7 @@ ThrowCompletionOr<PlainDate*> to_temporal_date(VM& vm, Value item, Object const* (void)TRY(to_temporal_overflow(vm, options)); // 5. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // 6. Let result be ? ParseTemporalDateString(string). auto result = TRY(parse_temporal_date_string(vm, string)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp index 2e4f49fa5d..983f986ff4 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTime.cpp @@ -165,7 +165,7 @@ ThrowCompletionOr<PlainDateTime*> to_temporal_date_time(VM& vm, Value item, Obje (void)TRY(to_temporal_overflow(vm, options)); // b. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // c. Let result be ? ParseTemporalDateTimeString(string). result = TRY(parse_temporal_date_time_string(vm, string)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp index d38bd18cd4..245466e55b 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainMonthDay.cpp @@ -120,7 +120,7 @@ ThrowCompletionOr<PlainMonthDay*> to_temporal_month_day(VM& vm, Value item, Obje (void)TRY(to_temporal_overflow(vm, options)); // 6. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // 7. Let result be ? ParseTemporalMonthDayString(string). auto result = TRY(parse_temporal_month_day_string(vm, string)); @@ -185,7 +185,7 @@ ThrowCompletionOr<DeprecatedString> temporal_month_day_to_string(VM& vm, PlainMo auto result = DeprecatedString::formatted("{:02}-{:02}", month_day.iso_month(), month_day.iso_day()); // 6. Let calendarID be ? ToString(monthDay.[[Calendar]]). - auto calendar_id = TRY(Value(&month_day.calendar()).to_string(vm)); + auto calendar_id = TRY(Value(&month_day.calendar()).to_deprecated_string(vm)); // 7. If showCalendar is one of "always" or "critical", or if calendarID is not "iso8601", then if (show_calendar.is_one_of("always"sv, "critical"sv) || calendar_id != "iso8601"sv) { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp index 62928a8e1e..8aab78db60 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainTime.cpp @@ -122,7 +122,7 @@ ThrowCompletionOr<PlainTime*> to_temporal_time(VM& vm, Value item, Optional<Stri auto* calendar = TRY(get_temporal_calendar_with_iso_default(vm, item_object)); // e. If ? ToString(calendar) is not "iso8601", then - auto calendar_identifier = TRY(Value(calendar).to_string(vm)); + auto calendar_identifier = TRY(Value(calendar).to_deprecated_string(vm)); if (calendar_identifier != "iso8601"sv) { // i. Throw a RangeError exception. return vm.throw_completion<RangeError>(ErrorType::TemporalInvalidCalendarIdentifier, calendar_identifier); @@ -137,7 +137,7 @@ ThrowCompletionOr<PlainTime*> to_temporal_time(VM& vm, Value item, Optional<Stri // 4. Else, else { // a. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // b. Let result be ? ParseTemporalTimeString(string). result = TRY(parse_temporal_time_string(vm, string)); diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp index cec9eaf007..5560ccc45d 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainYearMonth.cpp @@ -66,7 +66,7 @@ ThrowCompletionOr<PlainYearMonth*> to_temporal_year_month(VM& vm, Value item, Ob (void)TRY(to_temporal_overflow(vm, options)); // 5. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // 6. Let result be ? ParseTemporalYearMonthString(string). auto result = TRY(parse_temporal_year_month_string(vm, string)); @@ -212,7 +212,7 @@ ThrowCompletionOr<DeprecatedString> temporal_year_month_to_string(VM& vm, PlainY auto result = DeprecatedString::formatted("{}-{:02}", pad_iso_year(year_month.iso_year()), year_month.iso_month()); // 6. Let calendarID be ? ToString(yearMonth.[[Calendar]]). - auto calendar_id = TRY(Value(&year_month.calendar()).to_string(vm)); + auto calendar_id = TRY(Value(&year_month.calendar()).to_deprecated_string(vm)); // 7. If showCalendar is one of "always" or "critical", or if calendarID is not "iso8601", then if (show_calendar.is_one_of("always"sv, "critical"sv) || calendar_id != "iso8601") { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp index b20a243a69..97acc3770a 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZone.cpp @@ -332,7 +332,7 @@ ThrowCompletionOr<Object*> to_temporal_time_zone(VM& vm, Value temporal_time_zon } // 2. Let identifier be ? ToString(temporalTimeZoneLike). - auto identifier = TRY(temporal_time_zone_like.to_string(vm)); + auto identifier = TRY(temporal_time_zone_like.to_deprecated_string(vm)); // 3. Let parseResult be ? ParseTemporalTimeZoneString(identifier). auto parse_result = TRY(parse_temporal_time_zone_string(vm, identifier)); @@ -603,10 +603,10 @@ ThrowCompletionOr<bool> time_zone_equals(VM& vm, Object& one, Object& two) return true; // 2. Let timeZoneOne be ? ToString(one). - auto time_zone_one = TRY(Value(&one).to_string(vm)); + auto time_zone_one = TRY(Value(&one).to_deprecated_string(vm)); // 3. Let timeZoneTwo be ? ToString(two). - auto time_zone_two = TRY(Value(&two).to_string(vm)); + auto time_zone_two = TRY(Value(&two).to_deprecated_string(vm)); // 4. If timeZoneOne is timeZoneTwo, return true. if (time_zone_one == time_zone_two) diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp index 878dd7abf1..ea44f7e143 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZoneConstructor.cpp @@ -48,7 +48,7 @@ ThrowCompletionOr<NonnullGCPtr<Object>> TimeZoneConstructor::construct(FunctionO auto& vm = this->vm(); // 2. Set identifier to ? ToString(identifier). - auto identifier = TRY(vm.argument(0).to_string(vm)); + auto identifier = TRY(vm.argument(0).to_deprecated_string(vm)); // 3. If IsTimeZoneOffsetString(identifier) is false, then if (!is_time_zone_offset_string(identifier)) { diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp index f259fbb562..13a6462325 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/TimeZonePrototype.cpp @@ -244,7 +244,7 @@ JS_DEFINE_NATIVE_FUNCTION(TimeZonePrototype::to_json) auto* time_zone = TRY(typed_this_object(vm)); // 3. Return ? ToString(timeZone). - return PrimitiveString::create(vm, TRY(Value(time_zone).to_string(vm))); + return PrimitiveString::create(vm, TRY(Value(time_zone).to_deprecated_string(vm))); } } diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp index 5ac39db659..6a7bd94067 100644 --- a/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp +++ b/Userland/Libraries/LibJS/Runtime/Temporal/ZonedDateTime.cpp @@ -175,7 +175,7 @@ ThrowCompletionOr<ZonedDateTime*> to_temporal_zoned_date_time(VM& vm, Value item // k. Else, else { // i. Set offsetString to ? ToString(offsetString). - offset_string = TRY(offset_string_value.to_string(vm)); + offset_string = TRY(offset_string_value.to_deprecated_string(vm)); } // l. Let result be ? InterpretTemporalDateTimeFields(calendar, fields, options). @@ -187,7 +187,7 @@ ThrowCompletionOr<ZonedDateTime*> to_temporal_zoned_date_time(VM& vm, Value item (void)TRY(to_temporal_overflow(vm, options)); // b. Let string be ? ToString(item). - auto string = TRY(item.to_string(vm)); + auto string = TRY(item.to_deprecated_string(vm)); // c. Let result be ? ParseTemporalZonedDateTimeString(string). result = TRY(parse_temporal_zoned_date_time_string(vm, string)); @@ -342,7 +342,7 @@ ThrowCompletionOr<DeprecatedString> temporal_zoned_date_time_to_string(VM& vm, Z // 13. Else, else { // a. Let timeZoneID be ? ToString(timeZone). - auto time_zone_id = TRY(Value(&time_zone).to_string(vm)); + auto time_zone_id = TRY(Value(&time_zone).to_deprecated_string(vm)); // b. If showTimeZone is "critical", let flag be "!"; else let flag be the empty String. auto flag = show_time_zone == "critical"sv ? "!"sv : ""sv; diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index 47f86f8d87..1ad0b3bc16 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -753,7 +753,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::join) // 5. Else, let sep be ? ToString(separator). DeprecatedString separator = ","; if (!vm.argument(0).is_undefined()) - separator = TRY(vm.argument(0).to_string(vm)); + separator = TRY(vm.argument(0).to_deprecated_string(vm)); // 6. Let R be the empty String. StringBuilder builder; @@ -771,7 +771,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::join) // c. If element is undefined, let next be the empty String; otherwise, let next be ! ToString(element). if (element.is_undefined()) continue; - auto next = MUST(element.to_string(vm)); + auto next = MUST(element.to_deprecated_string(vm)); // d. Set R to the string-concatenation of R and next. builder.append(next); @@ -1556,7 +1556,7 @@ JS_DEFINE_NATIVE_FUNCTION(TypedArrayPrototype::to_locale_string) if (!next_element.is_nullish()) { // i. Let S be ? ToString(? Invoke(nextElement, "toLocaleString", « locales, options »)). auto locale_string_value = TRY(next_element.invoke(vm, vm.names.toLocaleString, locales, options)); - auto locale_string = TRY(locale_string_value.to_string(vm)); + auto locale_string = TRY(locale_string_value.to_deprecated_string(vm)); // ii. Set R to the string-concatenation of R and S. builder.append(locale_string); diff --git a/Userland/Libraries/LibJS/Runtime/Value.cpp b/Userland/Libraries/LibJS/Runtime/Value.cpp index 5007dd536a..571369d24e 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.cpp +++ b/Userland/Libraries/LibJS/Runtime/Value.cpp @@ -388,12 +388,12 @@ ThrowCompletionOr<PrimitiveString*> Value::to_primitive_string(VM& vm) { if (is_string()) return &as_string(); - auto string = TRY(to_string(vm)); + auto string = TRY(to_deprecated_string(vm)); return PrimitiveString::create(vm, string).ptr(); } // 7.1.17 ToString ( argument ), https://tc39.es/ecma262/#sec-tostring -ThrowCompletionOr<DeprecatedString> Value::to_string(VM& vm) const +ThrowCompletionOr<DeprecatedString> Value::to_deprecated_string(VM& vm) const { if (is_double()) return number_to_deprecated_string(m_value.as_double); @@ -430,7 +430,7 @@ ThrowCompletionOr<DeprecatedString> Value::to_string(VM& vm) const VERIFY(!primitive_value.is_object()); // 12. Return ? ToString(primValue). - return primitive_value.to_string(vm); + return primitive_value.to_deprecated_string(vm); } default: VERIFY_NOT_REACHED(); @@ -442,7 +442,7 @@ ThrowCompletionOr<Utf16String> Value::to_utf16_string(VM& vm) const if (is_string()) return TRY(as_string().utf16_string()); - auto utf8_string = TRY(to_string(vm)); + auto utf8_string = TRY(to_deprecated_string(vm)); return Utf16String::create(vm, utf8_string); } @@ -887,7 +887,7 @@ ThrowCompletionOr<PropertyKey> Value::to_property_key(VM& vm) const } // 3. Return ! ToString(key). - return MUST(key.to_string(vm)); + return MUST(key.to_deprecated_string(vm)); } // 7.1.6 ToInt32 ( argument ), https://tc39.es/ecma262/#sec-toint32 diff --git a/Userland/Libraries/LibJS/Runtime/Value.h b/Userland/Libraries/LibJS/Runtime/Value.h index 8fdb8e6b9b..bd3e3d0211 100644 --- a/Userland/Libraries/LibJS/Runtime/Value.h +++ b/Userland/Libraries/LibJS/Runtime/Value.h @@ -367,7 +367,7 @@ public: u64 encoded() const { return m_value.encoded; } - ThrowCompletionOr<DeprecatedString> to_string(VM&) const; + ThrowCompletionOr<DeprecatedString> to_deprecated_string(VM&) const; ThrowCompletionOr<Utf16String> to_utf16_string(VM&) const; ThrowCompletionOr<PrimitiveString*> to_primitive_string(VM&); ThrowCompletionOr<Value> to_primitive(VM&, PreferredType preferred_type = PreferredType::Default) const; |