mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 06:07:34 +00:00
LibJS: Convert ordinary_to_primitive() to ThrowCompletionOr
Also add spec step comments to it while we're here.
This commit is contained in:
parent
867b19affb
commit
fa2ac5b759
4 changed files with 26 additions and 13 deletions
|
@ -437,7 +437,7 @@ Value Value::to_primitive(GlobalObject& global_object, PreferredType preferred_t
|
|||
}
|
||||
if (preferred_type == PreferredType::Default)
|
||||
preferred_type = PreferredType::Number;
|
||||
return as_object().ordinary_to_primitive(preferred_type);
|
||||
return TRY_OR_DISCARD(as_object().ordinary_to_primitive(preferred_type));
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue