Title: [243397] tags/Safari-608.1.11.1/Source/_javascript_Core
Revision
243397
Author
alanc...@apple.com
Date
2019-03-22 12:07:35 -0700 (Fri, 22 Mar 2019)

Log Message

Cherry-pick r243311. rdar://problem/49113565

    [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):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243311 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: tags/Safari-608.1.11.1/Source/_javascript_Core/ChangeLog (243396 => 243397)


--- tags/Safari-608.1.11.1/Source/_javascript_Core/ChangeLog	2019-03-22 18:56:41 UTC (rev 243396)
+++ tags/Safari-608.1.11.1/Source/_javascript_Core/ChangeLog	2019-03-22 19:07:35 UTC (rev 243397)
@@ -1,3 +1,41 @@
+2019-03-22  Alan Coon  <alanc...@apple.com>
+
+        Cherry-pick r243311. rdar://problem/49113565
+
+    [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):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-03-21  Yusuke Suzuki  <ysuz...@apple.com>
+
+            [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-19  Devin Rousso  <drou...@apple.com>
 
         Web Inspector: Debugger: lazily create the agent

Modified: tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp (243396 => 243397)


--- tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-03-22 18:56:41 UTC (rev 243396)
+++ tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlDateTimeFormat.cpp	2019-03-22 19:07:35 UTC (rev 243397)
@@ -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: tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlNumberFormat.cpp (243396 => 243397)


--- tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-03-22 18:56:41 UTC (rev 243396)
+++ tags/Safari-608.1.11.1/Source/_javascript_Core/runtime/IntlNumberFormat.cpp	2019-03-22 19:07:35 UTC (rev 243397)
@@ -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
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to