Ver código fonte

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

Noticed this while working on [[RoundingMode]].
Timothy Flynn 3 anos atrás
pai
commit
cb5f7bf696

+ 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;
     else if (rounding_mode == "trunc"sv)
         m_rounding_mode = RoundingMode::Trunc;
+    else
+        VERIFY_NOT_REACHED();
 }
 
 StringView NumberFormatBase::trailing_zero_display_string() const