tor-browser

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

ASCII_Hex_Digit.js (1203B)


      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 `ASCII_Hex_Digit`
      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  ranges: [
     19    [0x000030, 0x000039],
     20    [0x000041, 0x000046],
     21    [0x000061, 0x000066]
     22  ]
     23 });
     24 testPropertyEscapes(
     25  /^\p{ASCII_Hex_Digit}+$/u,
     26  matchSymbols,
     27  "\\p{ASCII_Hex_Digit}"
     28 );
     29 testPropertyEscapes(
     30  /^\p{AHex}+$/u,
     31  matchSymbols,
     32  "\\p{AHex}"
     33 );
     34 
     35 const nonMatchSymbols = buildString({
     36  loneCodePoints: [],
     37  ranges: [
     38    [0x00DC00, 0x00DFFF],
     39    [0x000000, 0x00002F],
     40    [0x00003A, 0x000040],
     41    [0x000047, 0x000060],
     42    [0x000067, 0x00DBFF],
     43    [0x00E000, 0x10FFFF]
     44  ]
     45 });
     46 testPropertyEscapes(
     47  /^\P{ASCII_Hex_Digit}+$/u,
     48  nonMatchSymbols,
     49  "\\P{ASCII_Hex_Digit}"
     50 );
     51 testPropertyEscapes(
     52  /^\P{AHex}+$/u,
     53  nonMatchSymbols,
     54  "\\P{AHex}"
     55 );
     56 
     57 reportCompare(0, 0);