tor-browser

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

Unified_Ideograph.js (1813B)


      1 // Copyright 2025 Mathias Bynens. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 author: Mathias Bynens
      6 description: >
      7  Unicode property escapes for `Unified_Ideograph`
      8 info: |
      9  Generated by https://github.com/mathiasbynens/unicode-property-escapes-tests
     10  Unicode v17.0.0
     11 esid: sec-static-semantics-unicodematchproperty-p
     12 features: [regexp-unicode-property-escapes]
     13 includes: [regExpUtils.js]
     14 ---*/
     15 
     16 const matchSymbols = buildString({
     17  loneCodePoints: [
     18    0x00FA11,
     19    0x00FA1F,
     20    0x00FA21
     21  ],
     22  ranges: [
     23    [0x003400, 0x004DBF],
     24    [0x004E00, 0x009FFF],
     25    [0x00FA0E, 0x00FA0F],
     26    [0x00FA13, 0x00FA14],
     27    [0x00FA23, 0x00FA24],
     28    [0x00FA27, 0x00FA29],
     29    [0x020000, 0x02A6DF],
     30    [0x02A700, 0x02B81D],
     31    [0x02B820, 0x02CEAD],
     32    [0x02CEB0, 0x02EBE0],
     33    [0x02EBF0, 0x02EE5D],
     34    [0x030000, 0x03134A],
     35    [0x031350, 0x033479]
     36  ]
     37 });
     38 testPropertyEscapes(
     39  /^\p{Unified_Ideograph}+$/u,
     40  matchSymbols,
     41  "\\p{Unified_Ideograph}"
     42 );
     43 testPropertyEscapes(
     44  /^\p{UIdeo}+$/u,
     45  matchSymbols,
     46  "\\p{UIdeo}"
     47 );
     48 
     49 const nonMatchSymbols = buildString({
     50  loneCodePoints: [
     51    0x00FA10,
     52    0x00FA12,
     53    0x00FA20,
     54    0x00FA22
     55  ],
     56  ranges: [
     57    [0x00DC00, 0x00DFFF],
     58    [0x000000, 0x0033FF],
     59    [0x004DC0, 0x004DFF],
     60    [0x00A000, 0x00DBFF],
     61    [0x00E000, 0x00FA0D],
     62    [0x00FA15, 0x00FA1E],
     63    [0x00FA25, 0x00FA26],
     64    [0x00FA2A, 0x01FFFF],
     65    [0x02A6E0, 0x02A6FF],
     66    [0x02B81E, 0x02B81F],
     67    [0x02CEAE, 0x02CEAF],
     68    [0x02EBE1, 0x02EBEF],
     69    [0x02EE5E, 0x02FFFF],
     70    [0x03134B, 0x03134F],
     71    [0x03347A, 0x10FFFF]
     72  ]
     73 });
     74 testPropertyEscapes(
     75  /^\P{Unified_Ideograph}+$/u,
     76  nonMatchSymbols,
     77  "\\P{Unified_Ideograph}"
     78 );
     79 testPropertyEscapes(
     80  /^\P{UIdeo}+$/u,
     81  nonMatchSymbols,
     82  "\\P{UIdeo}"
     83 );
     84 
     85 reportCompare(0, 0);