Changeset 282897 in webkit


Ignore:
Timestamp:
Sep 22, 2021 5:39:19 PM (10 months ago)
Author:
ysuzuki@apple.com
Message:

[JSC] emoji and eor collations are missing
https://bugs.webkit.org/show_bug.cgi?id=230652

Reviewed by Ross Kirsling.

JSTests:

  • stress/intl-enumeration.js:
  • test262/expectations.yaml:

Source/JavaScriptCore:

Due to ICU's bug, "emoji" and "eor" collations are missing from enumeration.
This patch adds work-around for this.

  • runtime/IntlObject.cpp:

(JSC::availableCollations):

Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JSTests/ChangeLog

    r282890 r282897  
     12021-09-22  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] emoji and eor collations are missing
     4        https://bugs.webkit.org/show_bug.cgi?id=230652
     5
     6        Reviewed by Ross Kirsling.
     7
     8        * stress/intl-enumeration.js:
     9        * test262/expectations.yaml:
     10
    1112021-09-22  Yusuke Suzuki  <ysuzuki@apple.com>
    212
  • trunk/JSTests/stress/intl-enumeration.js

    r282018 r282897  
    2020
    2121let collations = Intl.supportedValuesOf("collation");
    22 shouldBe(JSON.stringify(collations), `["big5han","compat","dict","gb2312","phonebk","phonetic","pinyin","reformed","searchjl","stroke","trad","unihan","zhuyin"]`);
     22shouldBe(JSON.stringify(collations), `["big5han","compat","dict","emoji","eor","gb2312","phonebk","phonetic","pinyin","reformed","searchjl","stroke","trad","unihan","zhuyin"]`);
    2323
    2424let currencies = Intl.supportedValuesOf("currency");
  • trunk/JSTests/test262/expectations.yaml

    r282890 r282897  
    850850  default: 'Test262Error: Expected SameValue(«und-NO-u-sd-no23», «und-NO-u-sd-no50») to be true'
    851851  strict mode: 'Test262Error: Expected SameValue(«und-NO-u-sd-no23», «und-NO-u-sd-no50») to be true'
    852 test/intl402/Intl/supportedValuesOf/collations-accepted-by-Collator.js:
    853   default: 'Test262Error: emoji supported but not returned by supportedValuesOf'
    854   strict mode: 'Test262Error: emoji supported but not returned by supportedValuesOf'
    855852test/intl402/Intl/supportedValuesOf/currencies-accepted-by-DisplayNames.js:
    856853  default: 'Test262Error: ADP supported but not returned by supportedValuesOf'
  • trunk/Source/JavaScriptCore/ChangeLog

    r282890 r282897  
     12021-09-22  Yusuke Suzuki  <ysuzuki@apple.com>
     2
     3        [JSC] emoji and eor collations are missing
     4        https://bugs.webkit.org/show_bug.cgi?id=230652
     5
     6        Reviewed by Ross Kirsling.
     7
     8        Due to ICU's bug, "emoji" and "eor" collations are missing from enumeration.
     9        This patch adds work-around for this.
     10
     11        * runtime/IntlObject.cpp:
     12        (JSC::availableCollations):
     13
    1142021-09-22  Yusuke Suzuki  <ysuzuki@apple.com>
    215
  • trunk/Source/JavaScriptCore/runtime/IntlObject.cpp

    r282890 r282897  
    16581658
    16591659    Vector<String, 1> elements;
    1660     elements.reserveInitialCapacity(count);
     1660    elements.reserveInitialCapacity(count + 2);
     1661    // ICU ~69 has a bug that does not report "emoji" and "eor" for collation when using ucol_getKeywordValues.
     1662    // https://github.com/unicode-org/icu/commit/24778dfc9bf67f431509361a173a33a1ab860b5d
     1663    elements.append("emoji"_s);
     1664    elements.append("eor"_s);
    16611665    for (int32_t index = 0; index < count; ++index) {
    16621666        int32_t length = 0;
     
    16811685            return WTF::codePointCompare(a, b) < 0;
    16821686        });
     1687    auto end = std::unique(elements.begin(), elements.end());
     1688    elements.resize(elements.size() - (elements.end() - end));
    16831689
    16841690    RELEASE_AND_RETURN(scope, createArrayFromStringVector(globalObject, WTFMove(elements)));
Note: See TracChangeset for help on using the changeset viewer.