tor-browser

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

u-astral-char-class-invert.js (1122B)


      1 // Copyright (C) 2020 Alexey Shvayka. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 
      4 /*---
      5 esid: sec-atom
      6 description: >
      7  Literal astral symbols within inverted CharacterClass.
      8 info: |
      9  The production Atom :: CharacterClass evaluates as follows:
     10 
     11  1. Evaluate CharacterClass to obtain a CharSet A and a Boolean invert.
     12  2. Call CharacterSetMatcher(A, invert, direction) and return its Matcher result.
     13 
     14  Runtime Semantics: CharacterSetMatcher ( A, invert, direction )
     15 
     16  1. Return an internal Matcher closure that takes two arguments, a State x and
     17  a Continuation c, and performs the following steps:
     18    [...]
     19    f. Let cc be Canonicalize(ch).
     20    g. If invert is false, then
     21      [...]
     22    h. Else,
     23      i. Assert: invert is true.
     24      ii. If there exists a member a of set A such that Canonicalize(a) is cc,
     25      return failure.
     26 ---*/
     27 
     28 assert.sameValue(/^[^โค๏ธ]$/u.exec("โค๏ธ"), null);
     29 assert.sameValue(/^[^๐Ÿงก]/u.exec("๐Ÿงก"), null);
     30 assert.sameValue(/[^๐Ÿ’›]$/u.exec("๐Ÿ’›"), null);
     31 assert.sameValue(/[^๐Ÿ’š]/u.exec("๐Ÿ’š"), null);
     32 
     33 reportCompare(0, 0);