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:
parent
da59c77fe3
commit
96ab116f0d
8 changed files with 18 additions and 30 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue