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

LibJS+Everywhere: Deprecate Value::to_string_without_side_effects

This commit is contained in:
Timothy Flynn 2023-02-12 20:38:28 -05:00 committed by Linus Groh
parent 7fc7d4f8c6
commit b245300ba1
65 changed files with 168 additions and 168 deletions

View file

@ -39,7 +39,7 @@ namespace JS {
ThrowCompletionOr<Value> require_object_coercible(VM& vm, Value value)
{
if (value.is_nullish())
return vm.throw_completion<TypeError>(ErrorType::NotObjectCoercible, value.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotObjectCoercible, value.to_deprecated_string_without_side_effects());
return value;
}
@ -52,7 +52,7 @@ ThrowCompletionOr<Value> call_impl(VM& vm, Value function, Value this_value, Opt
// 2. If IsCallable(F) is false, throw a TypeError exception.
if (!function.is_function())
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, function.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, function.to_deprecated_string_without_side_effects());
// 3. Return ? F.[[Call]](V, argumentsList).
return function.as_function().internal_call(this_value, move(*arguments_list));
@ -100,7 +100,7 @@ ThrowCompletionOr<MarkedVector<Value>> create_list_from_array_like(VM& vm, Value
// 2. If Type(obj) is not Object, throw a TypeError exception.
if (!value.is_object())
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_deprecated_string_without_side_effects());
auto& array_like = value.as_object();
@ -144,7 +144,7 @@ ThrowCompletionOr<FunctionObject*> species_constructor(VM& vm, Object const& obj
// 3. If Type(C) is not Object, throw a TypeError exception.
if (!constructor.is_object())
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, constructor.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, constructor.to_deprecated_string_without_side_effects());
// 4. Let S be ? Get(C, @@species).
auto species = TRY(constructor.as_object().get(*vm.well_known_symbol_species()));
@ -158,7 +158,7 @@ ThrowCompletionOr<FunctionObject*> species_constructor(VM& vm, Object const& obj
return &species.as_function();
// 7. Throw a TypeError exception.
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, species.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAConstructor, species.to_deprecated_string_without_side_effects());
}
// 7.3.25 GetFunctionRealm ( obj ), https://tc39.es/ecma262/#sec-getfunctionrealm
@ -1223,7 +1223,7 @@ CanonicalIndex canonical_numeric_index_string(PropertyKey const& property_key, C
// FIXME: We return 0 instead of n but it might not observable?
// 3. If SameValue(! ToString(n), argument) is true, return n.
if (double_value.to_string_without_side_effects() == argument)
if (double_value.to_deprecated_string_without_side_effects() == argument)
return CanonicalIndex(CanonicalIndex::Type::Numeric, 0);
// 4. Return undefined.
@ -1333,7 +1333,7 @@ ThrowCompletionOr<void> add_disposable_resource(VM& vm, Vector<DisposableResourc
// b. If Type(V) is not Object, throw a TypeError exception.
if (!value.is_object())
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_deprecated_string_without_side_effects());
// c. Let resource be ? CreateDisposableResource(V, hint).
resource = TRY(create_disposable_resource(vm, value, hint));
@ -1349,7 +1349,7 @@ ThrowCompletionOr<void> add_disposable_resource(VM& vm, Vector<DisposableResourc
else {
// i. If Type(V) is not Object, throw a TypeError exception.
if (!value.is_object())
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, value.to_deprecated_string_without_side_effects());
// ii. Let resource be ? CreateDisposableResource(V, hint, method).
resource = TRY(create_disposable_resource(vm, value, hint, method));
@ -1378,7 +1378,7 @@ ThrowCompletionOr<DisposableResource> create_disposable_resource(VM& vm, Value v
// c. If method is undefined, throw a TypeError exception.
if (!method)
return vm.throw_completion<TypeError>(ErrorType::NoDisposeMethod, value.to_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NoDisposeMethod, value.to_deprecated_string_without_side_effects());
}
// 2. Else,
// a. If IsCallable(method) is false, throw a TypeError exception.