Title: [243311] trunk/Source/_javascript_Core
Revision
243311
Author
[email protected]
Date
2019-03-21 12:09:10 -0700 (Thu, 21 Mar 2019)

Log Message

[JSC] Fix JSC build with newer ICU
https://bugs.webkit.org/show_bug.cgi?id=196098

Reviewed by Keith Miller.

IntlDateTimeFormat and IntlNumberFormat have switch statement over ICU's enums. However it lacks "default" clause so that
the compile error occurs when a new enum value is added in ICU side. We should have "default" clause which just fallbacks
"unknown"_s case. The behavior is not changed since we already have `return "unknown"_s;` statement anyway after the
switch statement. This patch just suppresses a compile error.

* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString):
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::partTypeString):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (243310 => 243311)


--- trunk/Source/_javascript_Core/ChangeLog	2019-03-21 19:01:47 UTC (rev 243310)
+++ trunk/Source/_javascript_Core/ChangeLog	2019-03-21 19:09:10 UTC (rev 243311)
@@ -1,3 +1,20 @@
+2019-03-21  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Fix JSC build with newer ICU
+        https://bugs.webkit.org/show_bug.cgi?id=196098
+
+        Reviewed by Keith Miller.
+
+        IntlDateTimeFormat and IntlNumberFormat have switch statement over ICU's enums. However it lacks "default" clause so that
+        the compile error occurs when a new enum value is added in ICU side. We should have "default" clause which just fallbacks
+        "unknown"_s case. The behavior is not changed since we already have `return "unknown"_s;` statement anyway after the
+        switch statement. This patch just suppresses a compile error.
+
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::IntlDateTimeFormat::partTypeString):
+        * runtime/IntlNumberFormat.cpp:
+        (JSC::IntlNumberFormat::partTypeString):
+
 2019-03-21  Tadeu Zagallo  <[email protected]>
 
         JSObject::putDirectIndexSlowOrBeyondVectorLength should check if indexIsSufficientlyBeyondLengthForSparseMap

Modified: trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (243310 => 243311)


--- trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-03-21 19:01:47 UTC (rev 243310)
+++ trunk/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-03-21 19:09:10 UTC (rev 243311)
@@ -977,9 +977,10 @@
 #if U_ICU_VERSION_MAJOR_NUM < 58 || !defined(U_HIDE_DEPRECATED_API)
     case UDAT_FIELD_COUNT:
 #endif
+    // Any newer additions to the UDateFormatField enum should just be considered an "unknown" part.
+    default:
         return "unknown"_s;
     }
-    // Any newer additions to the UDateFormatField enum should just be considered an "unknown" part.
     return "unknown"_s;
 }
 

Modified: trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp (243310 => 243311)


--- trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-03-21 19:01:47 UTC (rev 243310)
+++ trunk/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-03-21 19:09:10 UTC (rev 243311)
@@ -476,9 +476,10 @@
 #if !defined(U_HIDE_DEPRECATED_API)
     case UNUM_FIELD_COUNT:
 #endif
+    // Any newer additions to the UNumberFormatFields enum should just be considered an "unknown" part.
+    default:
         return "unknown"_s;
     }
-    // Any newer additions to the UNumberFormatFields enum should just be considered an "unknown" part.
     return "unknown"_s;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to