浏览代码

LibJS: Add missing VERIFY_NOT_REACHED in string-to-enum conversion

Noticed this while working on [[RoundingMode]].
Timothy Flynn 3 年之前
父节点
当前提交
cb5f7bf696
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp

+ 2 - 0
Userland/Libraries/LibJS/Runtime/Intl/NumberFormat.cpp

@@ -215,6 +215,8 @@ void NumberFormatBase::set_rounding_mode(StringView rounding_mode)
         m_rounding_mode = RoundingMode::HalfTrunc;
         m_rounding_mode = RoundingMode::HalfTrunc;
     else if (rounding_mode == "trunc"sv)
     else if (rounding_mode == "trunc"sv)
         m_rounding_mode = RoundingMode::Trunc;
         m_rounding_mode = RoundingMode::Trunc;
+    else
+        VERIFY_NOT_REACHED();
 }
 }
 
 
 StringView NumberFormatBase::trailing_zero_display_string() const
 StringView NumberFormatBase::trailing_zero_display_string() const