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

LibJS: Unify Symbol::description() and raw_description()

Let callers take care of handling the empty optional case (undefined in
the spec).
This commit is contained in:
Linus Groh 2023-02-11 16:02:14 +00:00
parent fcdabd179a
commit 5e72fde954
5 changed files with 11 additions and 10 deletions

View file

@ -37,7 +37,7 @@ void FunctionObject::set_function_name(Variant<PropertyKey, PrivateName> const&
// 2. If Type(name) is Symbol, then
if (auto const* property_key = name_arg.get_pointer<PropertyKey>(); property_key && property_key->is_symbol()) {
// a. Let description be name's [[Description]] value.
auto const& description = property_key->as_symbol()->raw_description();
auto const& description = property_key->as_symbol()->description();
// b. If description is undefined, set name to the empty String.
if (!description.has_value())