From 296f47a008ef0aa397dcc09dac589efea5741241 Mon Sep 17 00:00:00 2001
From: Kevin Gibbons <kevin@shapesecurity.com>
Date: Mon, 5 Nov 2018 15:12:23 -0800
Subject: [PATCH] split non-unicode-property-names.js

---
 .../non-unicode-property-names.js             | 21 -------------------
 ...nvalid-non-id-continue-groupspecifier-2.js | 15 +++++++++++++
 ...nvalid-non-id-continue-groupspecifier-3.js | 15 +++++++++++++
 ...nvalid-non-id-continue-groupspecifier-4.js | 15 +++++++++++++
 .../invalid-non-id-continue-groupspecifier.js | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-2.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-3.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-4.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-5.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-6.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-7.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier-8.js  | 15 +++++++++++++
 .../invalid-non-id-start-groupspecifier.js    | 15 +++++++++++++
 .../invalid-u-escape-in-groupspecifier.js     | 15 +++++++++++++
 14 files changed, 195 insertions(+), 21 deletions(-)
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-2.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-3.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js
 create mode 100644 test/language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js

diff --git a/test/built-ins/RegExp/named-groups/non-unicode-property-names.js b/test/built-ins/RegExp/named-groups/non-unicode-property-names.js
index 9c02d0b517..4f062f7fb1 100644
--- a/test/built-ins/RegExp/named-groups/non-unicode-property-names.js
+++ b/test/built-ins/RegExp/named-groups/non-unicode-property-names.js
@@ -5,40 +5,19 @@
 description: Exotic named group names in non-Unicode RegExps
 esid: prod-GroupSpecifier
 features: [regexp-named-groups]
-includes: [compareArray.js]
 ---*/
 
 assert.sameValue("a", /(?<π>a)/.exec("bab").groups.π);
-assert.throws(SyntaxError, () => eval('/(?<\\u{03C0}>a)/'), "\\u{} escapes allowed only in Unicode mode");
 assert.sameValue("a", /(?<π>a)/.exec("bab").groups.\u03C0);
 assert.sameValue("a", /(?<$>a)/.exec("bab").groups.$);
 assert.sameValue("a", /(?<_>a)/.exec("bab").groups._);
-assert.throws(SyntaxError, () => eval('/(?<$𐒤>a)/'), "Individual surrogates not in ID_Continue");
 assert.sameValue("a", /(?<_\u200C>a)/.exec("bab").groups._\u200C);
 assert.sameValue("a", /(?<_\u200D>a)/.exec("bab").groups._\u200D);
 assert.sameValue("a", /(?<ಠ_ಠ>a)/.exec("bab").groups.ಠ_ಠ);
-assert.throws(SyntaxError, () => eval('/(?<❤>a)/'));
-assert.throws(SyntaxError, () => eval('/(?<𐒤>a)/'), "Individual surrogate not in ID_Start.");
 
 // Unicode escapes in capture names.
-assert.throws(SyntaxError, () => eval("/(?<a\\uD801\uDCA4>.)/"));
-assert.throws(SyntaxError, () => eval("/(?<a\\uD801>.)/"));
-assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/"));
 assert(/(?<\u0041>.)/.test("a"));
-assert.throws(SyntaxError, () => eval("/(?<a\\u{104A4}>.)/"));
-assert.throws(SyntaxError, () => eval("/(?<a\\u{10FFFF}>.)/"));
-assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/"), "Lea");
-assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/"), "Trai");
 assert(RegExp("(?<\u{0041}>.)").test("a"), "Non-surrogate");
 
-// Bracketed escapes are not allowed;
 // 4-char escapes must be the proper ID_Start/ID_Continue
-assert.throws(SyntaxError, () => eval("/(?<a\\uD801>.)/"), "Lead");
-assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/"), "Trail");
-assert.throws(SyntaxError, () => eval("/(?<\\u{0041}>.)/"), "Non-surrogate");
-assert.throws(SyntaxError, () => eval("/(?<a\\u{104A4}>.)/"), "Surrogate, ID_Continue");
 assert(RegExp("(?<\\u0041>.)").test("a"), "Non-surrogate");
-
-// Backslash is not allowed as ID_Start and ID_Continue
-assert.throws(SyntaxError, () => eval("/(?<\\>.)/"), "'\' misclassified as ID_Start");
-assert.throws(SyntaxError, () => eval("/(?<a\\>.)/"), "'\' misclassified as ID_Continue");
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-2.js b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-2.js
new file mode 100644
index 0000000000..e840db0553
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-2.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\uD801>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-3.js b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-3.js
new file mode 100644
index 0000000000..38f70fc6de
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-3.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\uDCA4>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js
new file mode 100644
index 0000000000..027cac11ec
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js
new file mode 100644
index 0000000000..4e2096a35e
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<$𐒤>a)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js
new file mode 100644
index 0000000000..64637b6a1c
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<𐒤>a)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js
new file mode 100644
index 0000000000..a4644b015b
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\uD801\uDCA4>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js
new file mode 100644
index 0000000000..e840db0553
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\uD801>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js
new file mode 100644
index 0000000000..38f70fc6de
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\uDCA4>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js
new file mode 100644
index 0000000000..f5cca3d309
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\u{104A4}>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js
new file mode 100644
index 0000000000..59b7ded346
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<a\u{10FFFF}>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js
new file mode 100644
index 0000000000..22f8452ce7
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<\>.)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js
new file mode 100644
index 0000000000..cdaff4016e
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.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: GroupSpecifier must be identifier-like.
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<❤>a)/;
diff --git a/test/language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.js
new file mode 100644
index 0000000000..6dfd5e5755
--- /dev/null
+++ b/test/language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier.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: \u{} escapes in GroupSpecifier allowed only in Unicode mode
+esid: prod-GroupSpecifier
+negative:
+  phase: parse
+  type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+throw "Test262: This statement should not be evaluated.";
+
+/(?<\u{0041}>a)/;
-- 
GitLab