mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:28:12 +00:00
LibJS: Use String::formatted() for throw_exception() message
This commit is contained in:
parent
a27668cbae
commit
f9eaac62d9
15 changed files with 64 additions and 64 deletions
|
@ -45,14 +45,14 @@ Object* get_iterator(GlobalObject& global_object, Value value, String hint, Valu
|
|||
return {};
|
||||
}
|
||||
if (!method.is_function()) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotIterable, value.to_string_without_side_effects().characters());
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotIterable, value.to_string_without_side_effects());
|
||||
return nullptr;
|
||||
}
|
||||
auto iterator = vm.call(method.as_function(), value);
|
||||
if (vm.exception())
|
||||
return {};
|
||||
if (!iterator.is_object()) {
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotIterable, value.to_string_without_side_effects().characters());
|
||||
vm.throw_exception<TypeError>(global_object, ErrorType::NotIterable, value.to_string_without_side_effects());
|
||||
return nullptr;
|
||||
}
|
||||
return &iterator.as_object();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue