mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:17:34 +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
|
@ -323,11 +323,11 @@ String Value::to_string_without_side_effects() const
|
|||
}
|
||||
}
|
||||
|
||||
PrimitiveString* Value::to_primitive_string(GlobalObject& global_object)
|
||||
ThrowCompletionOr<PrimitiveString*> Value::to_primitive_string(GlobalObject& global_object)
|
||||
{
|
||||
if (is_string())
|
||||
return &as_string();
|
||||
auto string = TRY_OR_DISCARD(to_string(global_object));
|
||||
auto string = TRY(to_string(global_object));
|
||||
return js_string(global_object.heap(), string);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue