⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 243397 in webkit


Ignore:
Timestamp:
Mar 22, 2019, 12:07:35 PM (7 years ago)
Author:
Alan Coon
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

Location:
tags/Safari-608.1.11.1/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tags/Safari-608.1.11.1/Source/JavaScriptCore/ChangeLog

    r243192 r243397  
     12019-03-22  Alan Coon  <alancoon@apple.com>
     2
     3        Cherry-pick r243311. rdar://problem/49113565
     4
     5    [JSC] Fix JSC build with newer ICU
     6    https://bugs.webkit.org/show_bug.cgi?id=196098
     7   
     8    Reviewed by Keith Miller.
     9   
     10    IntlDateTimeFormat and IntlNumberFormat have switch statement over ICU's enums. However it lacks "default" clause so that
     11    the compile error occurs when a new enum value is added in ICU side. We should have "default" clause which just fallbacks
     12    "unknown"_s case. The behavior is not changed since we already have `return "unknown"_s;` statement anyway after the
     13    switch statement. This patch just suppresses a compile error.
     14   
     15    * runtime/IntlDateTimeFormat.cpp:
     16    (JSC::IntlDateTimeFormat::partTypeString):
     17    * runtime/IntlNumberFormat.cpp:
     18    (JSC::IntlNumberFormat::partTypeString):
     19   
     20    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243311 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     21
     22    2019-03-21  Yusuke Suzuki  <ysuzuki@apple.com>
     23
     24            [JSC] Fix JSC build with newer ICU
     25            https://bugs.webkit.org/show_bug.cgi?id=196098
     26
     27            Reviewed by Keith Miller.
     28
     29            IntlDateTimeFormat and IntlNumberFormat have switch statement over ICU's enums. However it lacks "default" clause so that
     30            the compile error occurs when a new enum value is added in ICU side. We should have "default" clause which just fallbacks
     31            "unknown"_s case. The behavior is not changed since we already have `return "unknown"_s;` statement anyway after the
     32            switch statement. This patch just suppresses a compile error.
     33
     34            * runtime/IntlDateTimeFormat.cpp:
     35            (JSC::IntlDateTimeFormat::partTypeString):
     36            * runtime/IntlNumberFormat.cpp:
     37            (JSC::IntlNumberFormat::partTypeString):
     38
    1392019-03-19  Devin Rousso  <drousso@apple.com>
    240
  • tags/Safari-608.1.11.1/Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp

    r240557 r243397  
    978978    case UDAT_FIELD_COUNT:
    979979#endif
     980    // Any newer additions to the UDateFormatField enum should just be considered an "unknown" part.
     981    default:
    980982        return "unknown"_s;
    981983    }
    982     // Any newer additions to the UDateFormatField enum should just be considered an "unknown" part.
    983984    return "unknown"_s;
    984985}
  • tags/Safari-608.1.11.1/Source/JavaScriptCore/runtime/IntlNumberFormat.cpp

    r240992 r243397  
    477477    case UNUM_FIELD_COUNT:
    478478#endif
     479    // Any newer additions to the UNumberFormatFields enum should just be considered an "unknown" part.
     480    default:
    479481        return "unknown"_s;
    480482    }
    481     // Any newer additions to the UNumberFormatFields enum should just be considered an "unknown" part.
    482483    return "unknown"_s;
    483484}
Note: See TracChangeset for help on using the changeset viewer.