[INTL] Implement supportedLocalesOf on Intl Constructors
https://bugs.webkit.org/show_bug.cgi?id=147599
Patch by Andy VanWagoner <[email protected]> on 2015-09-15
Reviewed by Benjamin Poulain.
Source/JavaScriptCore:
Implements all of the abstract operations used by supportedLocalesOf,
except during canonicalization it does not replace redundant tags,
or subtags with their preferred values.
- icu/unicode/ucal.h: Added.
- icu/unicode/udat.h: Added.
- icu/unicode/umisc.h: Added.
- icu/unicode/unum.h: Added.
- icu/unicode/utypes.h: Clear the U_SHOW_CPLUSPLUS_API flag to prevent C++ headers from being included.
- runtime/CommonIdentifiers.h: Adde localeMatcher.
- runtime/IntlCollatorConstructor.cpp:
(JSC::IntlCollatorConstructorFuncSupportedLocalesOf): Implemented.
- runtime/IntlDateTimeFormatConstructor.cpp:
(JSC::IntlDateTimeFormatConstructorFuncSupportedLocalesOf): Implemented.
- runtime/IntlNumberFormatConstructor.cpp:
(JSC::IntlNumberFormatConstructorFuncSupportedLocalesOf): Implemented.
(JSC::canonicalizeLanguageTag):
(JSC::getCanonicalLangTag):
(JSC::getPrivateUseLangTag):
(JSC::getGrandfatheredLangTag):
(JSC::canonicalizeLocaleList):
(JSC::bestAvailableLocale):
(JSC::lookupSupportedLocales):
(JSC::bestFitSupportedLocales):
(JSC::supportedLocales):
(JSC::getIntlStringOption):
(JSC::getIntlBooleanOption):
- runtime/IntlObject.h:
- runtime/JSCJSValue.h: Added toLength.
- runtime/JSCJSValue.cpp: Added toLength.
(JSC::JSValue::toLength): Implement ToLength from ECMA 262 6.0 7.1.15
- runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::intlCollatorAvailableLocales): Added lazy locale list.
(JSC::JSGlobalObject::intlDateTimeFormatAvailableLocales): Added lazy locale list.
(JSC::JSGlobalObject::intlNumberFormatAvailableLocales): Added lazy locale list.
- runtime/JSGlobalObject.h:
LayoutTests:
- js/intl-collator-expected.txt: Added tests for supportedLocalesOf
- js/intl-datetimeformat-expected.txt: Added tests for supportedLocalesOf
- js/intl-numberformat-expected.txt: Added tests for supportedLocalesOf
- js/script-tests/intl-collator.js: Added tests for supportedLocalesOf
- js/script-tests/intl-datetimeformat.js: Added tests for supportedLocalesOf
- js/script-tests/intl-numberformat.js: Added tests for supportedLocalesOf