mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Test astral literals within inverted CharacterClass
This commit is contained in:
parent
2cae20333d
commit
7117cddeca
31
test/language/literals/regexp/u-astral-char-class-invert.js
Normal file
31
test/language/literals/regexp/u-astral-char-class-invert.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (C) 2020 Alexey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
esid: sec-atom
|
||||||
|
description: >
|
||||||
|
Literal astral symbols within inverted CharacterClass.
|
||||||
|
info: |
|
||||||
|
The production Atom :: CharacterClass evaluates as follows:
|
||||||
|
|
||||||
|
1. Evaluate CharacterClass to obtain a CharSet A and a Boolean invert.
|
||||||
|
2. Call CharacterSetMatcher(A, invert, direction) and return its Matcher result.
|
||||||
|
|
||||||
|
Runtime Semantics: CharacterSetMatcher ( A, invert, direction )
|
||||||
|
|
||||||
|
1. Return an internal Matcher closure that takes two arguments, a State x and
|
||||||
|
a Continuation c, and performs the following steps:
|
||||||
|
[...]
|
||||||
|
f. Let cc be Canonicalize(ch).
|
||||||
|
g. If invert is false, then
|
||||||
|
[...]
|
||||||
|
h. Else,
|
||||||
|
i. Assert: invert is true.
|
||||||
|
ii. If there exists a member a of set A such that Canonicalize(a) is cc,
|
||||||
|
return failure.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
assert.sameValue(/^[^❤️]$/u.exec("❤️"), null);
|
||||||
|
assert.sameValue(/^[^🧡]/u.exec("🧡"), null);
|
||||||
|
assert.sameValue(/[^💛]$/u.exec("💛"), null);
|
||||||
|
assert.sameValue(/[^💚]/u.exec("💚"), null);
|
Loading…
x
Reference in New Issue
Block a user