/ark/js_runtime/ecmascript/builtins/ |
D | builtins_locale.cpp | 40 JSHandle<JSLocale> locale = in LocaleConstructor() local 74 … JSHandle<JSLocale> result = JSLocale::InitializeLocale(thread, locale, localeString, optionsObj); in LocaleConstructor() 92 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in Maximize() local 93 icu::Locale source(*(locale->GetIcuLocale())); in Maximize() 124 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in Minimize() local 125 icu::Locale source(*(locale->GetIcuLocale())); in Minimize() 171 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in GetBaseName() local 172 icu::Locale icuLocale = icu::Locale::createFromName(locale->GetIcuLocale()->getBaseName()); in GetBaseName() 188 JSHandle<JSLocale> locale = JSHandle<JSLocale>::Cast(loc); in GetCalendar() local 189 JSHandle<EcmaString> calendar = JSLocale::NormalizeKeywordValue(thread, locale, "ca"); in GetCalendar() [all …]
|
D | builtins_string.cpp | 1368 …std::string locale = JSLocale::BestAvailableLocale(thread, availableLocales, noExtensionsLocale.ba… in ToLocaleLowerCase() local 1372 if (locale.empty()) { in ToLocaleLowerCase() 1373 locale = "und"; in ToLocaleLowerCase() 1379 icu::Locale icuLocale = icu::Locale::createFromName(locale.c_str()); in ToLocaleLowerCase() 1436 …std::string locale = JSLocale::BestAvailableLocale(thread, availableLocales, noExtensionsLocale.ba… in ToLocaleUpperCase() local 1440 if (locale.empty()) { in ToLocaleUpperCase() 1441 locale = "und"; in ToLocaleUpperCase() 1447 icu::Locale icuLocale = icu::Locale::createFromName(locale.c_str()); in ToLocaleUpperCase()
|
/ark/js_runtime/ecmascript/ |
D | js_locale.cpp | 62 …String> JSLocale::CanonicalizeUnicodeLocaleId(JSThread *thread, const JSHandle<EcmaString> &locale) in CanonicalizeUnicodeLocaleId() argument 65 if (!IsStructurallyValidLanguageTag(locale)) { in CanonicalizeUnicodeLocaleId() 69 if (locale->GetLength() == 0 || locale->IsUtf16()) { in CanonicalizeUnicodeLocaleId() 73 std::string localeCStr = ConvertToStdString(locale); in CanonicalizeUnicodeLocaleId() 294 const std::string &locale) in BestAvailableLocale() argument 297 std::string localeCandidate = locale; in BestAvailableLocale() 335 JSMutableHandle<EcmaString> locale(thread, JSTaggedValue::Undefined()); in LookupMatcher() local 337 locale.Update(requestedLocales->Get(thread, i)); in LookupMatcher() 340 ParsedLocale parsedResult = HandleLocale(locale); in LookupMatcher() 347 result.locale = availableLocale; in LookupMatcher() [all …]
|
D | js_locale.h | 123 std::string locale {}; 129 std::string locale; member 193 …ndle<EcmaString> CanonicalizeUnicodeLocaleId(JSThread *thread, const JSHandle<EcmaString> &locale); 210 const std::string &locale); 357 static bool IsWellCollation(const icu::Locale &locale, const std::string &value) in IsWellCollation() argument 363 return IsWellExtension<icu::Collator>(locale, "collation", value); in IsWellCollation() 366 static bool IsWellCalendar(const icu::Locale &locale, const std::string &value) in IsWellCalendar() argument 368 return IsWellExtension<icu::Calendar>(locale, "calendar", value); in IsWellCalendar() 372 … static bool IsWellExtension(const icu::Locale &locale, const char *key, const std::string &value) in IsWellExtension() argument 379 …icu::StringEnumeration *sequence = T::getKeywordValuesForLocale(key, icu::Locale(locale.getBaseNam… in IsWellExtension() [all …]
|
D | ecma_vm.h | 414 void SetIcuFormatterToCache(IcuFormatterType type, const std::string &locale, void *icuObj, 417 EcmaVM::IcuFormatter icuFormatter = IcuFormatter(locale, icuObj, deleteEntry); 421 void *GetIcuFormatterFromCache(IcuFormatterType type, std::string locale) in GetIcuFormatterFromCache() argument 426 if (icuFormatter.locale == locale) { in GetIcuFormatterFromCache() 539 std::string locale; member 544 IcuFormatter(const std::string &locale, void *icuObj, IcuDeleteEntry deleteEntry = nullptr) 545 : locale(locale), icuObj(icuObj), deleteEntry(deleteEntry) {} in locale() function
|
D | js_plural_rules.cpp | 107 for (const std::string &locale : icuAvailableLocales) { in BuildLocaleSet() local 108 JSHandle<EcmaString> localeStr = factory->NewFromStdString(locale); in BuildLocaleSet() 117 const char *locale = nullptr; in GetNextLocale() local 118 locale = locales->next(len, status); in GetNextLocale() 119 if (!U_SUCCESS(status) || locale == nullptr) { in GetNextLocale() 123 localeStr = std::string(locale); in GetNextLocale() 305 JSHandle<EcmaString> locale(thread, pluralRules->GetLocale()); in ResolvedOptions() local 306 PropertyDescriptor localeDesc(thread, JSHandle<JSTaggedValue>::Cast(locale), true, true, true); in ResolvedOptions()
|
D | js_date_time_format.cpp | 837 JSHandle<JSTaggedValue> locale(thread, dateTimeFormat->GetLocale()); in ResolvedOptions() local 839 JSObject::CreateDataPropertyOrThrow(thread, options, property, locale); in ResolvedOptions() 1237 std::unique_ptr<icu::Calendar> JSDateTimeFormat::BuildCalendar(const icu::Locale &locale, const icu… in BuildCalendar() argument 1240 … std::unique_ptr<icu::Calendar> calendar(icu::Calendar::createInstance(timeZone, locale, status)); in BuildCalendar() 1491 icu::Locale locale = *(dtf->GetIcuLocale()); in ConstructDateIntervalFormat() local 1496 locale.setUnicodeKeywordValue("hc", hcString, status); in ConstructDateIntervalFormat() 1505 icu::DateIntervalFormat::createInstance(skeleton, locale, status)); in ConstructDateIntervalFormat()
|
D | js_collator.cpp | 398 JSHandle<JSTaggedValue> locale(thread, collator->GetLocale()); in ResolvedOptions() local 399 JSObject::CreateDataPropertyOrThrow(thread, options, property, locale); in ResolvedOptions()
|
D | js_date_time_format.h | 184 …static std::unique_ptr<icu::Calendar> BuildCalendar(const icu::Locale &locale, const icu::TimeZone…
|
D | js_relative_time_format.cpp | 479 JSHandle<EcmaString> locale(thread, relativeTimeFormat->GetLocale()); in ResolvedOptions() local 480 PropertyDescriptor localeDesc(thread, JSHandle<JSTaggedValue>::Cast(locale), true, true, true); in ResolvedOptions()
|
D | js_number_format.cpp | 928 JSHandle<JSTaggedValue> locale(thread, numberFormat->GetLocale()); in ResolvedOptions() local 929 JSObject::CreateDataPropertyOrThrow(thread, options, property, locale); in ResolvedOptions()
|
D | global_env_constants.h | 206 …V(JSTaggedValue, LocaleString, LOCALE_STRING_INDEX, locale) …
|
/ark/ts2abc/test262/ |
D | es2015_tests.txt | 4840 intl402/Locale/constructor-locale-object.js 4916 intl402/Locale/canonicalize-locale-list-take-locale.js 4926 intl402/supportedLocalesOf-default-locale-and-zxx-locale.js 4943 intl402/default-locale-is-canonicalized.js 4975 intl402/Intl/getCanonicalLocales/get-locale.js 5064 intl402/DateTimeFormat/prototype/resolvedOptions/resolved-locale-with-hc-unicode.js 5137 intl402/default-locale-is-supported.js
|
/ark/ts2abc/testTs/ |
D | test-case.patch | 4429 +function log(locale: string) { 4431 + `${new Intl.DateTimeFormat(locale).format(date)} ${new Intl.NumberFormat(locale).format(count)… 10166 + locale.toFixed()
|