Changeset 283459 in webkit
- Timestamp:
- Oct 2, 2021, 7:12:39 PM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
-
ChangeLog (modified) (1 diff)
-
runtime/IntlDisplayNames.cpp (modified) (4 diffs)
-
runtime/IntlDisplayNames.h (modified) (1 diff)
-
runtime/IntlObject.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r283445 r283459 1 2021-10-02 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Enable Intl.DisplayNames without ICU version check 4 https://bugs.webkit.org/show_bug.cgi?id=231122 5 6 Reviewed by Ross Kirsling. 7 8 Now every port requires ICU 61.2 or later. Since Intl.DisplayNames requires ICU 61, we can enable it without ICU version check. 9 This simplifies Intl.DisplayNames code. 10 11 * runtime/IntlDisplayNames.cpp: 12 (JSC::IntlDisplayNames::initializeDisplayNames): 13 (JSC::IntlDisplayNames::of const): 14 * runtime/IntlDisplayNames.h: 15 * runtime/IntlObject.cpp: 16 (JSC::IntlObject::finishCreation): 17 1 18 2021-10-02 Yusuke Suzuki <ysuzuki@apple.com> 2 19 -
trunk/Source/JavaScriptCore/runtime/IntlDisplayNames.cpp
r281375 r283459 111 111 RETURN_IF_EXCEPTION(scope, void()); 112 112 113 #if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)114 113 UErrorCode status = U_ZERO_ERROR; 115 114 … … 139 138 return; 140 139 } 141 #else142 throwTypeError(globalObject, scope, "Failed to initialize Intl.DisplayNames since used feature is not supported in the linked ICU version"_s);143 return;144 #endif145 140 } 146 141 … … 152 147 auto scope = DECLARE_THROW_SCOPE(vm); 153 148 154 #if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)155 149 ASSERT(m_displayNames); 156 150 auto code = codeValue.toWTFString(globalObject); … … 357 351 } 358 352 return jsString(vm, String(buffer)); 359 #else360 UNUSED_PARAM(codeValue);361 throwTypeError(globalObject, scope, "Failed to initialize Intl.DisplayNames since used feature is not supported in the linked ICU version"_s);362 return { };363 #endif364 353 } 365 354 -
trunk/Source/JavaScriptCore/runtime/IntlDisplayNames.h
r281375 r283459 31 31 32 32 namespace JSC { 33 34 #if !defined(HAVE_ICU_U_LOCALE_DISPLAY_NAMES)35 // We need 61 or later since part of implementation uses UCURR_NARROW_SYMBOL_NAME.36 #if U_ICU_VERSION_MAJOR_NUM >= 6137 #define HAVE_ICU_U_LOCALE_DISPLAY_NAMES 138 #endif39 #endif40 33 41 34 enum class RelevantExtensionKey : uint8_t; -
trunk/Source/JavaScriptCore/runtime/IntlObject.cpp
r282925 r283459 154 154 Collator createCollatorConstructor DontEnum|PropertyCallback 155 155 DateTimeFormat createDateTimeFormatConstructor DontEnum|PropertyCallback 156 DisplayNames createDisplayNamesConstructor DontEnum|PropertyCallback 156 157 Locale createLocaleConstructor DontEnum|PropertyCallback 157 158 NumberFormat createNumberFormatConstructor DontEnum|PropertyCallback … … 239 240 ASSERT(inherits(vm, info())); 240 241 JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); 241 #if HAVE(ICU_U_LOCALE_DISPLAY_NAMES)242 putDirectWithoutTransition(vm, vm.propertyNames->DisplayNames, createDisplayNamesConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));243 #else244 UNUSED_PARAM(&createDisplayNamesConstructor);245 #endif246 242 #if HAVE(ICU_U_LIST_FORMATTER) 247 243 putDirectWithoutTransition(vm, vm.propertyNames->ListFormat, createListFormatConstructor(vm, this), static_cast<unsigned>(PropertyAttribute::DontEnum));
Note:
See TracChangeset
for help on using the changeset viewer.