mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:17:35 +00:00
LibJS+Everywhere: Deprecate Value::to_string_without_side_effects
This commit is contained in:
parent
7fc7d4f8c6
commit
b245300ba1
65 changed files with 168 additions and 168 deletions
|
@ -355,7 +355,7 @@ StringView Value::typeof() const
|
|||
}
|
||||
}
|
||||
|
||||
DeprecatedString Value::to_string_without_side_effects() const
|
||||
DeprecatedString Value::to_deprecated_string_without_side_effects() const
|
||||
{
|
||||
if (is_double())
|
||||
return number_to_deprecated_string(m_value.as_double);
|
||||
|
@ -525,7 +525,7 @@ ThrowCompletionOr<Value> Value::to_primitive(VM& vm, PreferredType preferred_typ
|
|||
return result;
|
||||
|
||||
// vi. Throw a TypeError exception.
|
||||
return vm.throw_completion<TypeError>(ErrorType::ToPrimitiveReturnedObject, to_string_without_side_effects(), hint);
|
||||
return vm.throw_completion<TypeError>(ErrorType::ToPrimitiveReturnedObject, to_deprecated_string_without_side_effects(), hint);
|
||||
}
|
||||
|
||||
// c. If preferredType is not present, let preferredType be number.
|
||||
|
@ -1225,7 +1225,7 @@ ThrowCompletionOr<FunctionObject*> Value::get_method(VM& vm, PropertyKey const&
|
|||
|
||||
// 4. If IsCallable(func) 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());
|
||||
|
||||
// 5. Return func.
|
||||
return &function.as_function();
|
||||
|
@ -2042,7 +2042,7 @@ ThrowCompletionOr<Value> instance_of(VM& vm, Value value, Value target)
|
|||
{
|
||||
// 1. If target is not an Object, throw a TypeError exception.
|
||||
if (!target.is_object())
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_string_without_side_effects());
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAnObject, target.to_deprecated_string_without_side_effects());
|
||||
|
||||
// 2. Let instOfHandler be ? GetMethod(target, @@hasInstance).
|
||||
auto* instance_of_handler = TRY(target.get_method(vm, *vm.well_known_symbol_has_instance()));
|
||||
|
@ -2055,7 +2055,7 @@ ThrowCompletionOr<Value> instance_of(VM& vm, Value value, Value target)
|
|||
|
||||
// 4. If IsCallable(target) is false, throw a TypeError exception.
|
||||
if (!target.is_function())
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, target.to_string_without_side_effects());
|
||||
return vm.throw_completion<TypeError>(ErrorType::NotAFunction, target.to_deprecated_string_without_side_effects());
|
||||
|
||||
// 5. Return ? OrdinaryHasInstance(target, V).
|
||||
return ordinary_has_instance(vm, target, value);
|
||||
|
@ -2090,7 +2090,7 @@ ThrowCompletionOr<Value> ordinary_has_instance(VM& vm, Value lhs, Value rhs)
|
|||
|
||||
// 5. If P is not an Object, throw a TypeError exception.
|
||||
if (!rhs_prototype.is_object())
|
||||
return vm.throw_completion<TypeError>(ErrorType::InstanceOfOperatorBadPrototype, rhs.to_string_without_side_effects());
|
||||
return vm.throw_completion<TypeError>(ErrorType::InstanceOfOperatorBadPrototype, rhs.to_deprecated_string_without_side_effects());
|
||||
|
||||
// 6. Repeat,
|
||||
while (true) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue