Debian Codegraph @

js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js

raw
1 // Copyright 2017 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3
4 /*---
5 description: Lone surrogates in RegExp group names
6 esid: prod-GroupSpecifier
7 features: [regexp-named-groups]
8 ---*/
9
10 assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/"), "Lead");
11 assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/"), "Trail");
12 assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/u"), "Lead with u flag");
13 assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/u"), "Trail with u flag");
14
15 reportCompare(0, 0);