Debian Codegraph @

js/src/tests/test262/language/literals/regexp/u-astral-char-class-invert.js

raw
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);