1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LbJS: Convert exception-related usages of Value::TDSWOSE to String

TDSWOSE being to_deprecated_string_without_side_effects.
This commit is contained in:
Timothy Flynn 2023-02-12 21:26:14 -05:00 committed by Linus Groh
parent 3ffb6d9b5a
commit a73b8292ed
47 changed files with 125 additions and 123 deletions

View file

@ -436,9 +436,9 @@ Completion CallExpression::throw_type_error_for_callee(Interpreter& interpreter,
auto& vm = interpreter.vm();
if (auto expression_string = this->expression_string(); expression_string.has_value())
return vm.throw_completion<TypeError>(ErrorType::IsNotAEvaluatedFrom, callee_value.to_deprecated_string_without_side_effects(), call_type, expression_string.release_value());
return vm.throw_completion<TypeError>(ErrorType::IsNotAEvaluatedFrom, TRY_OR_THROW_OOM(vm, callee_value.to_string_without_side_effects()), call_type, expression_string.release_value());
return vm.throw_completion<TypeError>(ErrorType::IsNotA, callee_value.to_deprecated_string_without_side_effects(), call_type);
return vm.throw_completion<TypeError>(ErrorType::IsNotA, TRY_OR_THROW_OOM(vm, callee_value.to_string_without_side_effects()), call_type);
}
// 13.3.6.1 Runtime Semantics: Evaluation, https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation
@ -1970,11 +1970,11 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::class_definition_e
if (super_class.is_null()) {
proto_parent = nullptr;
} else if (!super_class.is_constructor()) {
return vm.throw_completion<TypeError>(ErrorType::ClassExtendsValueNotAConstructorOrNull, super_class.to_deprecated_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::ClassExtendsValueNotAConstructorOrNull, TRY_OR_THROW_OOM(vm, super_class.to_string_without_side_effects()));
} else {
auto super_class_prototype = TRY(super_class.get(vm, vm.names.prototype));
if (!super_class_prototype.is_null() && !super_class_prototype.is_object())
return vm.throw_completion<TypeError>(ErrorType::ClassExtendsValueInvalidPrototype, super_class_prototype.to_deprecated_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::ClassExtendsValueInvalidPrototype, TRY_OR_THROW_OOM(vm, super_class_prototype.to_string_without_side_effects()));
if (super_class_prototype.is_null())
proto_parent = nullptr;