Ignore:
Timestamp:
Dec 17, 2015, 5:35:53 PM (9 years ago)
Author:
Sukolsak Sakshuwong
Message:

[INTL] Implement Collator Compare Functions
https://bugs.webkit.org/show_bug.cgi?id=147604

Reviewed by Darin Adler.

Source/JavaScriptCore:

This patch implements Intl.Collator.prototype.compare() according
to the ECMAScript 2015 Internationalization API spec (ECMA-402 2nd edition.)

  • runtime/IntlCollator.cpp:

(JSC::IntlCollator::~IntlCollator):
(JSC::sortLocaleData):
(JSC::searchLocaleData):
(JSC::IntlCollator::initializeCollator):
(JSC::IntlCollator::createCollator):
(JSC::IntlCollator::compareStrings):
(JSC::IntlCollator::usageString):
(JSC::IntlCollator::sensitivityString):
(JSC::IntlCollator::resolvedOptions):
(JSC::IntlCollator::setBoundCompare):
(JSC::IntlCollatorFuncCompare): Deleted.

  • runtime/IntlCollator.h:

(JSC::IntlCollator::usage): Deleted.
(JSC::IntlCollator::setUsage): Deleted.
(JSC::IntlCollator::locale): Deleted.
(JSC::IntlCollator::setLocale): Deleted.
(JSC::IntlCollator::collation): Deleted.
(JSC::IntlCollator::setCollation): Deleted.
(JSC::IntlCollator::numeric): Deleted.
(JSC::IntlCollator::setNumeric): Deleted.
(JSC::IntlCollator::sensitivity): Deleted.
(JSC::IntlCollator::setSensitivity): Deleted.
(JSC::IntlCollator::ignorePunctuation): Deleted.
(JSC::IntlCollator::setIgnorePunctuation): Deleted.

  • runtime/IntlCollatorConstructor.cpp:

(JSC::constructIntlCollator):
(JSC::callIntlCollator):
(JSC::sortLocaleData): Deleted.
(JSC::searchLocaleData): Deleted.
(JSC::initializeCollator): Deleted.

  • runtime/IntlCollatorPrototype.cpp:

(JSC::IntlCollatorFuncCompare):
(JSC::IntlCollatorPrototypeFuncResolvedOptions):

  • runtime/IntlObject.cpp:

(JSC::defaultLocale):
(JSC::convertICULocaleToBCP47LanguageTag):
(JSC::intlStringOption):
(JSC::resolveLocale):
(JSC::supportedLocales):

  • runtime/IntlObject.h:
  • runtime/JSGlobalObject.cpp:

(JSC::JSGlobalObject::intlCollatorAvailableLocales):
(JSC::JSGlobalObject::intlDateTimeFormatAvailableLocales):
(JSC::JSGlobalObject::intlNumberFormatAvailableLocales):

Source/WTF:

  • wtf/unicode/Collator.h:

LayoutTests:

  • js/intl-collator-expected.txt:
  • js/intl-collator.html:
  • js/script-tests/intl-collator.js:

(testCollator):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/IntlObject.h

    r193611 r194253  
    5959
    6060String defaultLocale();
     61void convertICULocaleToBCP47LanguageTag(String& locale);
    6162bool intlBooleanOption(ExecState&, JSValue options, PropertyName, bool& usesFallback);
    62 String intlStringOption(ExecState&, JSValue options, PropertyName, const HashSet<String>& values, const char* notFound, String fallback);
     63String intlStringOption(ExecState&, JSValue options, PropertyName, std::initializer_list<const char*> values, const char* notFound, const char* fallback);
    6364Vector<String> canonicalizeLocaleList(ExecState&, JSValue locales);
    64 HashMap<String, String> resolveLocale(const HashSet<String>& availableLocales, const Vector<String>& requestedLocales, const HashMap<String, String>& options, const Vector<String>& relevantExtensionKeys, Vector<String> (*localeData)(const String&, const String&));
     65HashMap<String, String> resolveLocale(const HashSet<String>& availableLocales, const Vector<String>& requestedLocales, const HashMap<String, String>& options, const char* const relevantExtensionKeys[], size_t relevantExtensionKeyCount, Vector<String> (*localeData)(const String&, size_t));
    6566JSValue supportedLocales(ExecState&, const HashSet<String>& availableLocales, const Vector<String>& requestedLocales, JSValue options);
    6667String removeUnicodeLocaleExtension(const String&);
Note: See TracChangeset for help on using the changeset viewer.