summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js
blob: c279b259008c1be9def2e6c8f2d57d748ca6d056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
description: Lone surrogates in RegExp group names
esid: prod-GroupSpecifier
features: [regexp-named-groups]
---*/

assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/"), "Lead");
assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/"), "Trail");
assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/u"), "Lead with u flag");
assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/u"), "Trail with u flag");

reportCompare(0, 0);