summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js')
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js
new file mode 100644
index 0000000000..c279b25900
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js
@@ -0,0 +1,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);