tor-browser

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

unicode_full_case_folding.js (1155B)


      1 // Copyright (C) 2022 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-runtime-semantics-canonicalize-ch
      6 description: >
      7  Case-insensitive Unicode RegExps should not apply full case folding mappings
      8 info: |
      9  Canonicalize ( _rer_, _ch_ )
     10  1. If _rer_.[[Unicode]] is *true* and _rer_.[[IgnoreCase]] is *true*, then
     11    a. If the file `CaseFolding.txt` of the Unicode Character Database provides
     12      a simple or common case folding mapping for _ch_, return the result of
     13      applying that mapping to _ch_.
     14    b. Return _ch_.
     15 
     16  See https://unicode.org/Public/UCD/latest/ucd/CaseFolding.txt for the case
     17  folding mappings.
     18 ---*/
     19 
     20 assert(/[\u0390]/ui.test("\u1fd3"), "\\u0390 does not match \\u1fd3");
     21 assert(/[\u1fd3]/ui.test("\u0390"), "\\u1fd3 does not match \\u0390");
     22 assert(/[\u03b0]/ui.test("\u1fe3"), "\\u03b0 does not match \\u1fe3");
     23 assert(/[\u1fe3]/ui.test("\u03b0"), "\\u1fe3 does not match \\u03b0");
     24 assert(/[\ufb05]/ui.test("\ufb06"), "\\ufb05 does not match \\ufb06");
     25 assert(/[\ufb06]/ui.test("\ufb05"), "\\ufb06 does not match \\ufb05");
     26 
     27 reportCompare(0, 0);