tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

unicode-ext-seq-with-attribute.js (1268B)


      1 // Copyright (C) 2017 André Bargull. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-initializecollator
      6 description: >
      7  Attributes in Unicode extension subtags should be ignored.
      8 info: |
      9  10.1.1 InitializeCollator ( collator, locales, options )
     10    ...
     11    15. For each element key of relevantExtensionKeys in List order, do
     12      a. If key is "co", then
     13          i. Let value be r.[[co]].
     14         ii. If value is null, let value be "default".
     15        iii. Set collator.[[Collation]] to value.
     16    ...
     17 
     18  10.3.5 Intl.Collator.prototype.resolvedOptions ()
     19    The function returns a new object whose properties and attributes are set as if constructed
     20    by an object literal assigning to each of the following properties the value of the
     21    corresponding internal slot of this Collator object (see 10.4): ...
     22 ---*/
     23 
     24 var colExpected = new Intl.Collator("de-u-attrval-co-phonebk");
     25 var colActual = new Intl.Collator("de-u-co-phonebk");
     26 
     27 var resolvedExpected = colExpected.resolvedOptions();
     28 var resolvedActual = colActual.resolvedOptions();
     29 
     30 assert.sameValue(resolvedActual.locale, resolvedExpected.locale);
     31 assert.sameValue(resolvedActual.collation, resolvedExpected.collation);
     32 
     33 reportCompare(0, 0);