mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 12:17:35 +00:00
LibJS: Remove unnecessary braces in Intl.DisplayNames
Just caught my eye as I was modifying this code.
This commit is contained in:
parent
c6f3856d4f
commit
853ccab9af
1 changed files with 13 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2021, Tim Flynn <trflynn89@pm.me>
|
* Copyright (c) 2021-2022, Tim Flynn <trflynn89@pm.me>
|
||||||
*
|
*
|
||||||
* SPDX-License-Identifier: BSD-2-Clause
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
*/
|
*/
|
||||||
|
@ -19,15 +19,14 @@ DisplayNames::DisplayNames(Object& prototype)
|
||||||
|
|
||||||
void DisplayNames::set_style(StringView style)
|
void DisplayNames::set_style(StringView style)
|
||||||
{
|
{
|
||||||
if (style == "narrow"sv) {
|
if (style == "narrow"sv)
|
||||||
m_style = Style::Narrow;
|
m_style = Style::Narrow;
|
||||||
} else if (style == "short"sv) {
|
else if (style == "short"sv)
|
||||||
m_style = Style::Short;
|
m_style = Style::Short;
|
||||||
} else if (style == "long"sv) {
|
else if (style == "long"sv)
|
||||||
m_style = Style::Long;
|
m_style = Style::Long;
|
||||||
} else {
|
else
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StringView DisplayNames::style_string() const
|
StringView DisplayNames::style_string() const
|
||||||
|
@ -46,17 +45,16 @@ StringView DisplayNames::style_string() const
|
||||||
|
|
||||||
void DisplayNames::set_type(StringView type)
|
void DisplayNames::set_type(StringView type)
|
||||||
{
|
{
|
||||||
if (type == "language"sv) {
|
if (type == "language"sv)
|
||||||
m_type = Type::Language;
|
m_type = Type::Language;
|
||||||
} else if (type == "region"sv) {
|
else if (type == "region"sv)
|
||||||
m_type = Type::Region;
|
m_type = Type::Region;
|
||||||
} else if (type == "script"sv) {
|
else if (type == "script"sv)
|
||||||
m_type = Type::Script;
|
m_type = Type::Script;
|
||||||
} else if (type == "currency"sv) {
|
else if (type == "currency"sv)
|
||||||
m_type = Type::Currency;
|
m_type = Type::Currency;
|
||||||
} else {
|
else
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StringView DisplayNames::type_string() const
|
StringView DisplayNames::type_string() const
|
||||||
|
@ -77,13 +75,12 @@ StringView DisplayNames::type_string() const
|
||||||
|
|
||||||
void DisplayNames::set_fallback(StringView fallback)
|
void DisplayNames::set_fallback(StringView fallback)
|
||||||
{
|
{
|
||||||
if (fallback == "none"sv) {
|
if (fallback == "none"sv)
|
||||||
m_fallback = Fallback::None;
|
m_fallback = Fallback::None;
|
||||||
} else if (fallback == "code"sv) {
|
else if (fallback == "code"sv)
|
||||||
m_fallback = Fallback::Code;
|
m_fallback = Fallback::Code;
|
||||||
} else {
|
else
|
||||||
VERIFY_NOT_REACHED();
|
VERIFY_NOT_REACHED();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
StringView DisplayNames::fallback_string() const
|
StringView DisplayNames::fallback_string() const
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue