1
Fork 0
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:
Linus Groh 2021-10-02 15:13:09 +01:00
parent 867b19affb
commit fa2ac5b759
4 changed files with 26 additions and 13 deletions

View file

@ -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;
}