1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-30 22:08:12 +00:00

LibJS: Use String::formatted() for throw_exception() message

This commit is contained in:
Linus Groh 2020-10-04 13:55:20 +01:00 committed by Andreas Kling
parent a27668cbae
commit f9eaac62d9
15 changed files with 64 additions and 64 deletions

View file

@ -38,7 +38,7 @@ static Object* get_target_object_from(GlobalObject& global_object, const String&
auto& vm = global_object.vm();
auto target = vm.argument(0);
if (!target.is_object()) {
vm.throw_exception<TypeError>(global_object, ErrorType::ReflectArgumentMustBeAnObject, name.characters());
vm.throw_exception<TypeError>(global_object, ErrorType::ReflectArgumentMustBeAnObject, name);
return nullptr;
}
return static_cast<Object*>(&target.as_object());
@ -49,7 +49,7 @@ static Function* get_target_function_from(GlobalObject& global_object, const Str
auto& vm = global_object.vm();
auto target = vm.argument(0);
if (!target.is_function()) {
vm.throw_exception<TypeError>(global_object, ErrorType::ReflectArgumentMustBeAFunction, name.characters());
vm.throw_exception<TypeError>(global_object, ErrorType::ReflectArgumentMustBeAFunction, name);
return nullptr;
}
return &target.as_function();