summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/literals/regexp/named-groups
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/language/literals/regexp/named-groups')
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/browser.js0
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/forward-reference.js12
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname.js21
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js20
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js20
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js20
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js20
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js15
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js16
-rw-r--r--js/src/tests/test262/language/literals/regexp/named-groups/shell.js0
58 files changed, 957 insertions, 0 deletions
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/browser.js b/js/src/tests/test262/language/literals/regexp/named-groups/browser.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/browser.js
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/forward-reference.js b/js/src/tests/test262/language/literals/regexp/named-groups/forward-reference.js
new file mode 100644
index 0000000000..2f8588f751
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/forward-reference.js
@@ -0,0 +1,12 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Named groups can be forward references.
+esid: sec-atomescape
+features: [regexp-named-groups]
+---*/
+
+assert(/\k<a>(?<a>x)/.test("x"));
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js
new file mode 100644
index 0000000000..52c85bb005
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)\k<ab>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js
new file mode 100644
index 0000000000..98acd42120
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)\k<ab>/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js
new file mode 100644
index 0000000000..ab2512d83e
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<ab>a)\k<a>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js
new file mode 100644
index 0000000000..9995ddaed8
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<ab>a)\k<a>/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js
new file mode 100644
index 0000000000..c2a97ae631
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a>(?<ab>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js
new file mode 100644
index 0000000000..f410a00797
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a>(?<ab>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js
new file mode 100644
index 0000000000..d42ee9e35c
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a>(?<b>x)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js
new file mode 100644
index 0000000000..f30c4f8aa7
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<b>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js
new file mode 100644
index 0000000000..3598f94426
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname.js
new file mode 100644
index 0000000000..ca192d22e1
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-dangling-groupname.js
@@ -0,0 +1,21 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: Group reference must have corresponding group.
+info: |
+ It is a Syntax Error if the enclosing Pattern does not contain a
+ GroupSpecifier with an enclosed RegExpIdentifierName whose StringValue
+ equals the StringValue of the RegExpIdentifierName of this production's
+ GroupName.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<b>/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js
new file mode 100644
index 0000000000..5019ab119f
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupSpecifiers within one alternative must be unique.
+info: |
+ It is a Syntax Error if |Pattern| contains two distinct |GroupSpecifier|s
+ _x_ and _y_ for which CapturingGroupName(_x_) is the same as
+ CapturingGroupName(_y_) and such that CanBothParticipate(_x_, _y_) is *true*.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)(?<b>b)(?<a>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js
new file mode 100644
index 0000000000..8ed19cedc5
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupSpecifiers within one alternative must be unique.
+info: |
+ It is a Syntax Error if |Pattern| contains two distinct |GroupSpecifier|s
+ _x_ and _y_ for which CapturingGroupName(_x_) is the same as
+ CapturingGroupName(_y_) and such that CanBothParticipate(_x_, _y_) is *true*.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)(?<b>b)(?<a>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js
new file mode 100644
index 0000000000..efc8218273
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupSpecifiers within one alternative must be unique.
+info: |
+ It is a Syntax Error if |Pattern| contains two distinct |GroupSpecifier|s
+ _x_ and _y_ for which CapturingGroupName(_x_) is the same as
+ CapturingGroupName(_y_) and such that CanBothParticipate(_x_, _y_) is *true*.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)(?<a>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js
new file mode 100644
index 0000000000..628eb10a82
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js
@@ -0,0 +1,20 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupSpecifiers within one alternative must be unique.
+info: |
+ It is a Syntax Error if |Pattern| contains two distinct |GroupSpecifier|s
+ _x_ and _y_ for which CapturingGroupName(_x_) is the same as
+ CapturingGroupName(_y_) and such that CanBothParticipate(_x_, _y_) is *true*.
+esid: sec-patterns-static-semantics-early-errors
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>a)(?<a>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js
new file mode 100644
index 0000000000..83a09b9956
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js
new file mode 100644
index 0000000000..90f4ee1afb
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js
new file mode 100644
index 0000000000..0bb1f1327e
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>\a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js
new file mode 100644
index 0000000000..2eba873154
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<a/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js
new file mode 100644
index 0000000000..f100d3f1f3
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-2.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<a/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js
new file mode 100644
index 0000000000..c0a550e311
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js
new file mode 100644
index 0000000000..261544e03f
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k<>/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js
new file mode 100644
index 0000000000..93d9a6a8fb
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a(?<a>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js
new file mode 100644
index 0000000000..9ae652fbfc
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a(?<a>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js
new file mode 100644
index 0000000000..2053830a01
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k(?<a>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js
new file mode 100644
index 0000000000..3a74d7d7e0
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js
new file mode 100644
index 0000000000..21f0d481a8
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<>/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js
new file mode 100644
index 0000000000..0d5ddc0ca9
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js
new file mode 100644
index 0000000000..717ee16c2a
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/\k<a/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname.js
new file mode 100644
index 0000000000..7487e008c1
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-incomplete-groupname.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// Copyright 2017 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+description: GroupName is `< RegExpIdentifierName >`.
+esid: prod-GroupName
+negative:
+ phase: parse
+ type: SyntaxError
+features: [regexp-named-groups]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a>.)\k/;
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);
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js
new file mode 100644
index 0000000000..d7bcc1770a
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\>.)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js
new file mode 100644
index 0000000000..4dfa419755
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js
new file mode 100644
index 0000000000..38807e1c86
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<$❞>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js
new file mode 100644
index 0000000000..230092e8ef
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<𐒤>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js
new file mode 100644
index 0000000000..b25da28a84
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<𐒤>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js
new file mode 100644
index 0000000000..289bc4ca5c
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-3.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\uD83D\uDF12>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js
new file mode 100644
index 0000000000..0dacb1134d
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\uD801>.)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js
new file mode 100644
index 0000000000..92e0e30821
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\uD801>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js
new file mode 100644
index 0000000000..44249276ea
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\uDCA4>.)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js
new file mode 100644
index 0000000000..90df2cc5b5
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\uDCA4>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js
new file mode 100644
index 0000000000..bb2f21ee55
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-6.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\u{1F08B}>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js
new file mode 100644
index 0000000000..8ebbc51ea1
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-7.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\u{10FFFF}>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js
new file mode 100644
index 0000000000..e2f9d21f68
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<\>.)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js
new file mode 100644
index 0000000000..63777657b1
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<\>.)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js
new file mode 100644
index 0000000000..4002519fd0
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a\u{110000}>.)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js
new file mode 100644
index 0000000000..82cc67c825
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<❤>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js
new file mode 100644
index 0000000000..3958b2d282
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<❤>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js
new file mode 100644
index 0000000000..4f31018512
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<42a>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js
new file mode 100644
index 0000000000..19244144bc
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<42a>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js
new file mode 100644
index 0000000000..5128e74e8a
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<:a>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js
new file mode 100644
index 0000000000..e22331acdb
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<:a>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js
new file mode 100644
index 0000000000..b9d7fcba6c
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a:>a)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js
new file mode 100644
index 0000000000..08d11b25dc
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<a:>a)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js
new file mode 100644
index 0000000000..fc8cfd4a8e
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<aa)/u;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js
new file mode 100644
index 0000000000..e2c7bdb4fb
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js
@@ -0,0 +1,16 @@
+// |reftest| error:SyntaxError
+// 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]
+---*/
+
+$DONOTEVALUATE();
+
+/(?<aa)/;
diff --git a/js/src/tests/test262/language/literals/regexp/named-groups/shell.js b/js/src/tests/test262/language/literals/regexp/named-groups/shell.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/js/src/tests/test262/language/literals/regexp/named-groups/shell.js