tor-browser

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

basic.js (932B)


      1 // Copyright 2018 Igalia S.L. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-Intl.Segmenter.supportedLocalesOf
      6 description: Tests that Intl.Segmenter has a supportedLocalesOf property, and it works as expected.
      7 features: [Intl.Segmenter]
      8 ---*/
      9 
     10 assert.sameValue(typeof Intl.Segmenter.supportedLocalesOf, "function",
     11                 "supportedLocalesOf should be supported.");
     12 
     13 const defaultLocale = new Intl.Segmenter().resolvedOptions().locale;
     14 const notSupported = "zxx"; // "no linguistic content"
     15 const requestedLocales = [defaultLocale, notSupported];
     16 
     17 const supportedLocales = Intl.Segmenter.supportedLocalesOf(requestedLocales);
     18 assert.sameValue(supportedLocales.length, 1, "The length of supported locales list is not 1.");
     19 assert.sameValue(supportedLocales[0], defaultLocale, "The default locale is not returned in the supported list.");
     20 
     21 reportCompare(0, 0);