1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +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

@ -48,14 +48,14 @@ ThrowCompletionOr<Iterator> get_iterator(VM& vm, Value value, IteratorHint hint,
// NOTE: Additional type check to produce a better error message than Call().
if (!method->is_function())
return vm.throw_completion<TypeError>(ErrorType::NotIterable, value.to_deprecated_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotIterable, TRY_OR_THROW_OOM(vm, value.to_string_without_side_effects()));
// 3. Let iterator be ? Call(method, obj).
auto iterator = TRY(call(vm, *method, value));
// 4. If Type(iterator) is not Object, throw a TypeError exception.
if (!iterator.is_object())
return vm.throw_completion<TypeError>(ErrorType::NotIterable, value.to_deprecated_string_without_side_effects());
return vm.throw_completion<TypeError>(ErrorType::NotIterable, TRY_OR_THROW_OOM(vm, value.to_string_without_side_effects()));
// 5. Let nextMethod be ? GetV(iterator, "next").
auto next_method = TRY(iterator.get(vm, vm.names.next));