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

LibJS: Convert to_primitive_string() to ThrowCompletionOr

This commit is contained in:
Linus Groh 2021-10-12 18:05:46 +01:00
parent da59c77fe3
commit 96ab116f0d
8 changed files with 18 additions and 30 deletions

View file

@ -633,9 +633,7 @@ ThrowCompletionOr<Value> get_option(GlobalObject& global_object, Object const& o
// 6. If type is "string", then
else {
// a. Let value be ? ToString(value).
value = value.to_primitive_string(global_object);
if (auto* exception = vm.exception())
return throw_completion(exception->value());
value = TRY(value.to_primitive_string(global_object));
}
// 7. If values is not undefined and values does not contain an element equal to value, throw a RangeError exception.