[INTL] Implement supportedLocalesOf on Intl Constructors
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 17:43:27 +0000 (17:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 15 Sep 2015 17:43:27 +0000 (17:43 +0000)
commit1750e1ed3c484fd43379b99a78866285398ff3eb
treef22e7d6d9546ed211cc915926dc6e03a45453fb6
parent78ff967feefd88244a4478eef5f006f481496a59
[INTL] Implement supportedLocalesOf on Intl Constructors
https://bugs.webkit.org/show_bug.cgi?id=147599

Patch by Andy VanWagoner <thetalecrafter@gmail.com> 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.
* runtime/IntlObject.cpp:
(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

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@189811 268f45cc-cd09-0410-ab3c-d52691b4dbfc
23 files changed:
LayoutTests/ChangeLog
LayoutTests/js/intl-collator-expected.txt
LayoutTests/js/intl-datetimeformat-expected.txt
LayoutTests/js/intl-numberformat-expected.txt
LayoutTests/js/script-tests/intl-collator.js
LayoutTests/js/script-tests/intl-datetimeformat.js
LayoutTests/js/script-tests/intl-numberformat.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/icu/unicode/ucal.h [new file with mode: 0644]
Source/JavaScriptCore/icu/unicode/udat.h [new file with mode: 0644]
Source/JavaScriptCore/icu/unicode/umisc.h [new file with mode: 0644]
Source/JavaScriptCore/icu/unicode/unum.h [new file with mode: 0644]
Source/JavaScriptCore/icu/unicode/utypes.h
Source/JavaScriptCore/runtime/CommonIdentifiers.h
Source/JavaScriptCore/runtime/IntlCollatorConstructor.cpp
Source/JavaScriptCore/runtime/IntlDateTimeFormatConstructor.cpp
Source/JavaScriptCore/runtime/IntlNumberFormatConstructor.cpp
Source/JavaScriptCore/runtime/IntlObject.cpp
Source/JavaScriptCore/runtime/IntlObject.h
Source/JavaScriptCore/runtime/JSCJSValue.cpp
Source/JavaScriptCore/runtime/JSCJSValue.h
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h