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

LibJS: Convert Intl.DisplayNames to use Unicode::Style

This commit is contained in:
Timothy Flynn 2022-01-25 11:43:07 -05:00 committed by Linus Groh
parent bced4e9324
commit 25e67f63a2
3 changed files with 11 additions and 44 deletions

View file

@ -7,7 +7,6 @@
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Intl/AbstractOperations.h>
#include <LibJS/Runtime/Intl/DisplayNames.h>
#include <LibUnicode/Locale.h>
namespace JS::Intl {
@ -17,32 +16,6 @@ DisplayNames::DisplayNames(Object& prototype)
{
}
void DisplayNames::set_style(StringView style)
{
if (style == "narrow"sv)
m_style = Style::Narrow;
else if (style == "short"sv)
m_style = Style::Short;
else if (style == "long"sv)
m_style = Style::Long;
else
VERIFY_NOT_REACHED();
}
StringView DisplayNames::style_string() const
{
switch (m_style) {
case Style::Narrow:
return "narrow"sv;
case Style::Short:
return "short"sv;
case Style::Long:
return "long"sv;
default:
VERIFY_NOT_REACHED();
}
}
void DisplayNames::set_type(StringView type)
{
if (type == "language"sv)