tor-browser

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

Emoji_Component.js (1513B)


      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 `Emoji_Component`
      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    0x000023,
     19    0x00002A,
     20    0x00200D,
     21    0x0020E3,
     22    0x00FE0F
     23  ],
     24  ranges: [
     25    [0x000030, 0x000039],
     26    [0x01F1E6, 0x01F1FF],
     27    [0x01F3FB, 0x01F3FF],
     28    [0x01F9B0, 0x01F9B3],
     29    [0x0E0020, 0x0E007F]
     30  ]
     31 });
     32 testPropertyEscapes(
     33  /^\p{Emoji_Component}+$/u,
     34  matchSymbols,
     35  "\\p{Emoji_Component}"
     36 );
     37 testPropertyEscapes(
     38  /^\p{EComp}+$/u,
     39  matchSymbols,
     40  "\\p{EComp}"
     41 );
     42 
     43 const nonMatchSymbols = buildString({
     44  loneCodePoints: [],
     45  ranges: [
     46    [0x00DC00, 0x00DFFF],
     47    [0x000000, 0x000022],
     48    [0x000024, 0x000029],
     49    [0x00002B, 0x00002F],
     50    [0x00003A, 0x00200C],
     51    [0x00200E, 0x0020E2],
     52    [0x0020E4, 0x00DBFF],
     53    [0x00E000, 0x00FE0E],
     54    [0x00FE10, 0x01F1E5],
     55    [0x01F200, 0x01F3FA],
     56    [0x01F400, 0x01F9AF],
     57    [0x01F9B4, 0x0E001F],
     58    [0x0E0080, 0x10FFFF]
     59  ]
     60 });
     61 testPropertyEscapes(
     62  /^\P{Emoji_Component}+$/u,
     63  nonMatchSymbols,
     64  "\\P{Emoji_Component}"
     65 );
     66 testPropertyEscapes(
     67  /^\P{EComp}+$/u,
     68  nonMatchSymbols,
     69  "\\P{EComp}"
     70 );
     71 
     72 reportCompare(0, 0);