Blame SOURCES/icu60.patch

cd3348
--- a/Source/JavaScriptCore/runtime/IntlCache.cpp	
cd3348
+++ a/Source/JavaScriptCore/runtime/IntlCache.cpp	
cd3348
@@ -26,6 +26,7 @@ 
cd3348
 #include "config.h"
cd3348
 #include "IntlCache.h"
cd3348
 
cd3348
+#include "IntlDisplayNames.h"
cd3348
 #include <wtf/Vector.h>
cd3348
 
cd3348
 namespace JSC {
cd3348
@@ -53,6 +54,7 @@ Vector<UChar, 32> IntlCache::getBestDateTimePattern(const CString& locale, const
cd3348
     return patternBuffer;
cd3348
 }
cd3348
 
cd3348
+#if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
 Vector<UChar, 32> IntlCache::getFieldDisplayName(const CString& locale, UDateTimePatternField field, UDateTimePGDisplayWidth width, UErrorCode& status)
cd3348
 {
cd3348
     auto sharedGenerator = getSharedPatternGenerator(locale, status);
cd3348
@@ -64,5 +66,6 @@ Vector<UChar, 32> IntlCache::getFieldDisplayName(const CString& locale, UDateTim
cd3348
         return { };
cd3348
     return buffer;
cd3348
 }
cd3348
+#endif
cd3348
 
cd3348
 } // namespace JSC
cd3348
--- a/Source/JavaScriptCore/runtime/IntlCache.h	
cd3348
+++ a/Source/JavaScriptCore/runtime/IntlCache.h	
cd3348
@@ -25,6 +25,7 @@ 
cd3348
 
cd3348
 #pragma once
cd3348
 
cd3348
+#include "IntlDisplayNames.h"
cd3348
 #include <unicode/udatpg.h>
cd3348
 #include <wtf/Noncopyable.h>
cd3348
 #include <wtf/text/CString.h>
cd3348
@@ -39,7 +40,9 @@ public:
cd3348
     IntlCache() = default;
cd3348
 
cd3348
     Vector<UChar, 32> getBestDateTimePattern(const CString& locale, const UChar* skeleton, unsigned skeletonSize, UErrorCode&);
cd3348
+#if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
     Vector<UChar, 32> getFieldDisplayName(const CString& locale, UDateTimePatternField, UDateTimePGDisplayWidth, UErrorCode&);
cd3348
+#endif
cd3348
 
cd3348
 private:
cd3348
     UDateTimePatternGenerator* getSharedPatternGenerator(const CString& locale, UErrorCode& status)
cd3348
--- a/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp	
cd3348
+++ a/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp	
cd3348
@@ -110,6 +110,7 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa
cd3348
     m_languageDisplay = intlOption<LanguageDisplay>(globalObject, options, vm.propertyNames->languageDisplay, { { "dialect"_s, LanguageDisplay::Dialect }, { "standard"_s, LanguageDisplay::Standard } }, "languageDisplay must be either \"dialect\" or \"standard\""_s, LanguageDisplay::Dialect);
cd3348
     RETURN_IF_EXCEPTION(scope, void());
cd3348
 
cd3348
+#if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
     UErrorCode status = U_ZERO_ERROR;
cd3348
 
cd3348
     UDisplayContext contexts[] = {
cd3348
@@ -137,6 +138,10 @@ void IntlDisplayNames::initializeDisplayNames(JSGlobalObject* globalObject, JSVa
cd3348
         throwTypeError(globalObject, scope, "failed to initialize DisplayNames"_s);
cd3348
         return;
cd3348
     }
cd3348
+#else
cd3348
+    throwTypeError(globalObject, scope, "Failed to initialize Intl.DisplayNames since used feature is not supported in the linked ICU version"_s);
cd3348
+    return;
cd3348
+#endif
cd3348
 }
cd3348
 
cd3348
 // https://tc39.es/proposal-intl-displaynames/#sec-Intl.DisplayNames.prototype.of
cd3348
@@ -146,6 +151,7 @@ JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) co
cd3348
     VM& vm = globalObject->vm();
cd3348
     auto scope = DECLARE_THROW_SCOPE(vm);
cd3348
 
cd3348
+#if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
     ASSERT(m_displayNames);
cd3348
     auto code = codeValue.toWTFString(globalObject);
cd3348
     RETURN_IF_EXCEPTION(scope, { });
cd3348
@@ -350,6 +356,11 @@ JSValue IntlDisplayNames::of(JSGlobalObject* globalObject, JSValue codeValue) co
cd3348
         return throwTypeError(globalObject, scope, "Failed to query a display name."_s);
cd3348
     }
cd3348
     return jsString(vm, String(buffer));
cd3348
+#else
cd3348
+    UNUSED_PARAM(codeValue);
cd3348
+    throwTypeError(globalObject, scope, "Failed to initialize Intl.DisplayNames since used feature is not supported in the linked ICU version"_s);
cd3348
+    return { };
cd3348
+#endif
cd3348
 }
cd3348
 
cd3348
 // https://tc39.es/proposal-intl-displaynames/#sec-Intl.DisplayNames.prototype.resolvedOptions
cd3348
--- a/Source/JavaScriptCore/runtime/IntlDisplayNames.h	
cd3348
+++ a/Source/JavaScriptCore/runtime/IntlDisplayNames.h	
cd3348
@@ -31,6 +31,13 @@ 
cd3348
 
cd3348
 namespace JSC {
cd3348
 
cd3348
+#if !defined(HAVE_ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
+// We need 61 or later since part of implementation uses UCURR_NARROW_SYMBOL_NAME.
cd3348
+#if U_ICU_VERSION_MAJOR_NUM >= 61
cd3348
+#define HAVE_ICU_U_LOCALE_DISPLAY_NAMES 1
cd3348
+#endif
cd3348
+#endif
cd3348
+
cd3348
 enum class RelevantExtensionKey : uint8_t;
cd3348
 
cd3348
 class IntlDisplayNames final : public JSNonFinalObject {
cd3348
--- a/Source/JavaScriptCore/runtime/IntlObject.cpp	
cd3348
+++ a/Source/JavaScriptCore/runtime/IntlObject.cpp	
cd3348
@@ -153,7 +153,6 @@ namespace JSC {
cd3348
   getCanonicalLocales   intlObjectFuncGetCanonicalLocales            DontEnum|Function 1
cd3348
   Collator              createCollatorConstructor                    DontEnum|PropertyCallback
cd3348
   DateTimeFormat        createDateTimeFormatConstructor              DontEnum|PropertyCallback
cd3348
-  DisplayNames          createDisplayNamesConstructor                DontEnum|PropertyCallback
cd3348
   Locale                createLocaleConstructor                      DontEnum|PropertyCallback
cd3348
   NumberFormat          createNumberFormatConstructor                DontEnum|PropertyCallback
cd3348
   PluralRules           createPluralRulesConstructor                 DontEnum|PropertyCallback
cd3348
@@ -239,6 +238,11 @@ void IntlObject::finishCreation(VM& vm, JSGlobalObject* globalObject)
cd3348
     Base::finishCreation(vm);
cd3348
     ASSERT(inherits(vm, info()));
cd3348
     JSC_TO_STRING_TAG_WITHOUT_TRANSITION();
cd3348
+#if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)
cd3348
+    putDirectWithoutTransition(vm, vm.propertyNames->DisplayNames, createDisplayNamesConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));
cd3348
+#else
cd3348
+    UNUSED_PARAM(&createDisplayNamesConstructor);
cd3348
+#endif
cd3348
 #if HAVE(ICU_U_LIST_FORMATTER)
cd3348
     putDirectWithoutTransition(vm, vm.propertyNames->ListFormat, createListFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));
cd3348
 #else
cd3348
--- a/Source/cmake/OptionsGTK.cmake	
cd3348
+++ a/Source/cmake/OptionsGTK.cmake	
cd3348
@@ -14,7 +14,7 @@ find_package(Freetype 2.4.2 REQUIRED)
cd3348
 find_package(LibGcrypt 1.6.0 REQUIRED)
cd3348
 find_package(GLIB 2.56.4 REQUIRED COMPONENTS gio gio-unix gobject gthread gmodule)
cd3348
 find_package(HarfBuzz 0.9.18 REQUIRED COMPONENTS ICU)
cd3348
-find_package(ICU 61.2 REQUIRED COMPONENTS data i18n uc)
cd3348
+find_package(ICU 60.2 REQUIRED COMPONENTS data i18n uc)
cd3348
 find_package(JPEG REQUIRED)
cd3348
 find_package(LibXml2 2.8.0 REQUIRED)
cd3348
 find_package(PNG REQUIRED)