diff --git a/test/built-ins/RegExp/named-groups/non-unicode-malformed.js b/test/built-ins/RegExp/named-groups/non-unicode-malformed.js deleted file mode 100644 index 37d47a692a..0000000000 --- a/test/built-ins/RegExp/named-groups/non-unicode-malformed.js +++ /dev/null @@ -1,35 +0,0 @@ -// 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 in Unicode RegExps have some syntax errors and some - compatibility escape fallback behavior. -esid: prod-GroupSpecifier -features: [regexp-named-groups] -includes: [compareArray.js] ----*/ - -assert.throws(SyntaxError, () => eval("/(?<>a)/")); -assert.throws(SyntaxError, () => eval("/(? eval("/(?<42a>a)/")); -assert.throws(SyntaxError, () => eval("/(?<:a>a)/")); -assert.throws(SyntaxError, () => eval("/(?a)/")); -assert.throws(SyntaxError, () => eval("/(?a)(?a)/")); -assert.throws(SyntaxError, () => eval("/(?a)(?b)(?a)/")); - -assert.throws(SyntaxError, () => eval("/(?.)\\k/")); -assert.throws(SyntaxError, () => eval("/(?.)\\k eval("/(?.)\\k<>/")); -assert.throws(SyntaxError, () => eval("/(?.)\\k/")); -assert.throws(SyntaxError, () => eval("/(?a)\\k/")); -assert.throws(SyntaxError, () => eval("/(?a)\\k/")); -assert.throws(SyntaxError, () => eval("/\\k(?a)/")); -assert.throws(SyntaxError, () => eval("/\\ka)/")); - -// A couple of corner cases around '\k' as named back-references vs. identity -// escapes. -assert(/\k(?x)/.test("x")); -assert.throws(SyntaxError, () => eval("/\\k(?x)/")); -assert.throws(SyntaxError, () => eval("/\\k.)/")); -assert.throws(SyntaxError, () => eval("/\\k(?.)/")); 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("/(?.)/")); -assert.throws(SyntaxError, () => eval("/(?.)/")); -assert.throws(SyntaxError, () => eval("/(?.)/")); assert(/(?<\u0041>.)/.test("a")); -assert.throws(SyntaxError, () => eval("/(?.)/")); -assert.throws(SyntaxError, () => eval("/(?.)/")); -assert.throws(SyntaxError, () => eval("/(?.)/"), "Lea"); -assert.throws(SyntaxError, () => eval("/(?.)/"), "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("/(?.)/"), "Lead"); -assert.throws(SyntaxError, () => eval("/(?.)/"), "Trail"); -assert.throws(SyntaxError, () => eval("/(?<\\u{0041}>.)/"), "Non-surrogate"); -assert.throws(SyntaxError, () => eval("/(?.)/"), "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("/(?.)/"), "'\' misclassified as ID_Continue"); diff --git a/test/built-ins/RegExp/named-groups/unicode-malformed.js b/test/built-ins/RegExp/named-groups/unicode-malformed.js deleted file mode 100644 index 5c9c131a48..0000000000 --- a/test/built-ins/RegExp/named-groups/unicode-malformed.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2017 the V8 project authors. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: Various syntax errors for Unicode RegExps containing named groups -esid: prod-GroupSpecifier -features: [regexp-named-groups] ----*/ - -assert.throws(SyntaxError, () => eval("/(?<>a)/u"), "Empty name"); -assert.throws(SyntaxError, () => eval("/(? eval("/(?<42a>a)/u"), "Name starting with digits"); -assert.throws(SyntaxError, () => eval("/(?<:a>a)/u"), "Name starting with invalid char"); -assert.throws(SyntaxError, () => eval("/(?a)/u"), "Name containing with invalid char"); -assert.throws(SyntaxError, () => eval("/(?a)(?a)/u"), "Duplicate name"); -assert.throws(SyntaxError, () => eval("/(?a)(?b)(?a)/u"), "Duplicate name"); -assert.throws(SyntaxError, () => eval("/\\k/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/\\k eval("/\\k<>/u"), "Empty reference"); -assert.throws(SyntaxError, () => eval("/\\k/u"), "Lone \k"); -assert.throws(SyntaxError, () => eval("/(?.)\\k/u"), "Lone \k"); -assert.throws(SyntaxError, () => eval("/(?.)\\k eval("/(?.)\\k<>/u"), "Empty reference"); -assert.throws(SyntaxError, () => eval("/(?.)\\k/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?a)\\k/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?a)\\k/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/\\k(?a)/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?\\a)/u"), "Identity escape in capture"); - diff --git a/test/built-ins/RegExp/named-groups/unicode-property-names.js b/test/built-ins/RegExp/named-groups/unicode-property-names.js index 24e4a6ade9..27bf125746 100644 --- a/test/built-ins/RegExp/named-groups/unicode-property-names.js +++ b/test/built-ins/RegExp/named-groups/unicode-property-names.js @@ -17,30 +17,14 @@ assert.sameValue("a", /(?<$𐒤>a)/u.exec("bab").groups.$𐒤); assert.sameValue("a", /(?<_\u200C>a)/u.exec("bab").groups._\u200C); assert.sameValue("a", /(?<_\u200D>a)/u.exec("bab").groups._\u200D); assert.sameValue("a", /(?<ಠ_ಠ>a)/u.exec("bab").groups.ಠ_ಠ); -assert.throws(SyntaxError, () => eval('/(?<❤>a)/u')); -assert.throws(SyntaxError, () => eval('/(?<𐒤>a)/u'), "ID_Continue but not ID_Start."); // Unicode escapes in capture names. assert(/(?.)/u.test("a"), "\\u Lead \\u Trail"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "\\u Lea"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "\\u Trai"); assert(/(?<\u0041>.)/u.test("a"), "\\u NonSurrogate"); assert(/(?<\u{0041}>.)/u.test("a"), "\\u{ Non-surrogate }"); assert(/(?.)/u.test("a"), "\\u{ Surrogate, ID_Continue }"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "\\u{ Out-of-bounds "); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "Lea"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "Trai"); assert(RegExp("(?<\u{0041}>.)", "u").test("a"), "Non-surrogate"); assert(RegExp("(?.)", "u").test("a"), "Surrogate,ID_Continue"); - -// Bracketed escapes are not allowed; -// 4-char escapes must be the proper ID_Start/ID_Continue -assert.throws(SyntaxError, () => eval("/(?.)/u"), "Lead"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "Trail"); assert((/(?<\u{0041}>.)/u).test("a"), "Non-surrogate"); assert(/(?.)/u.test("a"), "Surrogate, ID_Continue"); assert(RegExp("(?<\\u0041>.)", "u").test("a"), "Non-surrogate"); - -// Backslash is not allowed as ID_Start and ID_Continue -assert.throws(SyntaxError, () => eval("/(?<\\>.)/u"), "'\' misclassified as ID_Start"); -assert.throws(SyntaxError, () => eval("/(?.)/u"), "'\' misclassified as ID_Continue"); diff --git a/test/language/literals/regexp/named-groups/forward-reference.js b/test/language/literals/regexp/named-groups/forward-reference.js new file mode 100644 index 0000000000..a6dd3c37f2 --- /dev/null +++ b/test/language/literals/regexp/named-groups/forward-reference.js @@ -0,0 +1,10 @@ +// 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(?x)/.test("x")); diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js new file mode 100644 index 0000000000..264709e7d9 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2-u.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js new file mode 100644 index 0000000000..ec03c951d7 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-2.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)\k/; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js new file mode 100644 index 0000000000..b0690b5167 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3-u.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js new file mode 100644 index 0000000000..48489ff589 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-3.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)\k/; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js new file mode 100644 index 0000000000..fecebf654e --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4-u.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k(?a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js new file mode 100644 index 0000000000..fac6cad35e --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-4.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k(?a)/; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js new file mode 100644 index 0000000000..582bf29d8a --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k(?x)/; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js new file mode 100644 index 0000000000..dd14be10ab --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-u.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js new file mode 100644 index 0000000000..004618ede4 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname.js new file mode 100644 index 0000000000..b215f8c46b --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname.js @@ -0,0 +1,20 @@ +// 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] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k/; diff --git a/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js new file mode 100644 index 0000000000..70707a499f --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2-u.js @@ -0,0 +1,18 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: GroupSpecifiers must be unique. +info: | + It is a Syntax Error if Pattern contains multiple GroupSpecifiers + whose enclosed RegExpIdentifierNames have the same StringValue. +esid: sec-patterns-static-semantics-early-errors +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)(?b)(?a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js new file mode 100644 index 0000000000..1ca18d9242 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-2.js @@ -0,0 +1,18 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: GroupSpecifiers must be unique. +info: | + It is a Syntax Error if Pattern contains multiple GroupSpecifiers + whose enclosed RegExpIdentifierNames have the same StringValue. +esid: sec-patterns-static-semantics-early-errors +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)(?b)(?a)/; diff --git a/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js new file mode 100644 index 0000000000..bac9221490 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier-u.js @@ -0,0 +1,18 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: GroupSpecifiers must be unique. +info: | + It is a Syntax Error if Pattern contains multiple GroupSpecifiers + whose enclosed RegExpIdentifierNames have the same StringValue. +esid: sec-patterns-static-semantics-early-errors +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)(?a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js new file mode 100644 index 0000000000..1cbc8c2e27 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-duplicate-groupspecifier.js @@ -0,0 +1,18 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +description: GroupSpecifiers must be unique. +info: | + It is a Syntax Error if Pattern contains multiple GroupSpecifiers + whose enclosed RegExpIdentifierNames have the same StringValue. +esid: sec-patterns-static-semantics-early-errors +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?a)(?a)/; diff --git a/test/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.js new file mode 100644 index 0000000000..44a86c1c5a --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-empty-groupspecifier-u.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; diff --git a/test/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-empty-groupspecifier.js new file mode 100644 index 0000000000..1050d96060 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-empty-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-identity-escape-in-capture-u.js b/test/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.js new file mode 100644 index 0000000000..0f46b0e1dc --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-identity-escape-in-capture-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?\a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.js new file mode 100644 index 0000000000..ed0d2ff019 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-2-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k<>/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-3.js new file mode 100644 index 0000000000..9fe83adaae --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k<>/; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-4.js new file mode 100644 index 0000000000..0406bad509 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\ka)/; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-5.js new file mode 100644 index 0000000000..5f46988659 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-6.js new file mode 100644 index 0000000000..88f9039386 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k(?.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.js new file mode 100644 index 0000000000..636b69a578 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.js new file mode 100644 index 0000000000..d953a42877 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-2-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k<>/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.js new file mode 100644 index 0000000000..f8c41abbfe --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-3-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.js new file mode 100644 index 0000000000..b7e22617e6 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-without-group-u.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: GroupName is `< RegExpIdentifierName >`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/\k`. +esid: prod-GroupName +negative: + phase: parse + type: SyntaxError +features: [regexp-named-groups] +---*/ + +throw "Test262: This statement should not be evaluated."; + +/(?.)\k/; diff --git a/test/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js b/test/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js new file mode 100644 index 0000000000..7be757996b --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-lone-surrogate-groupname.js @@ -0,0 +1,13 @@ +// 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("/(?.)/"), "Lead"); +assert.throws(SyntaxError, () => eval("/(?.)/"), "Trail"); +assert.throws(SyntaxError, () => eval("/(?.)/u"), "Lead with u flag"); +assert.throws(SyntaxError, () => eval("/(?.)/u"), "Trail with u flag"); diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.js new file mode 100644 index 0000000000..45b1ca6333 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-continue-groupspecifier-4-u.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."; + +/(?.)/u; 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."; + +/(?.)/; 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-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.js new file mode 100644 index 0000000000..fdc8775572 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-2-u.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; 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."; + +/(?.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.js new file mode 100644 index 0000000000..af260334db --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-4-u.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."; + +/(?.)/u; 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."; + +/(?.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.js new file mode 100644 index 0000000000..fb3d9c414b --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-5-u.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."; + +/(?.)/u; 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."; + +/(?.)/; 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."; + +/(?.)/; 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."; + +/(?.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.js new file mode 100644 index 0000000000..7796572c74 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-8-u.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."; + +/(?<\>.)/u; 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-9-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.js new file mode 100644 index 0000000000..7fff1ae790 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-9-u.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."; + +/(?.)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.js new file mode 100644 index 0000000000..ea4a41b5f8 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-non-id-start-groupspecifier-u.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; 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-numeric-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.js new file mode 100644 index 0000000000..c5ede73e6f --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-numeric-groupspecifier-u.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."; + +/(?<42a>a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-numeric-groupspecifier.js new file mode 100644 index 0000000000..235e780734 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-numeric-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."; + +/(?<42a>a)/; diff --git a/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js new file mode 100644 index 0000000000..b55f2b5453 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.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>a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js new file mode 100644 index 0000000000..3e646904a1 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-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>a)/; diff --git a/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.js new file mode 100644 index 0000000000..1419cddb5f --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier-u.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; diff --git a/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js new file mode 100644 index 0000000000..8fec9b8ff9 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-punctuator-within-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-2.js b/test/language/literals/regexp/named-groups/invalid-u-escape-in-groupspecifier-2.js new file mode 100644 index 0000000000..7d58dc86b0 --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-u-escape-in-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: \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{03C0}>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..53f7b96bf6 --- /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}>.)/; diff --git a/test/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.js new file mode 100644 index 0000000000..d84c30e4dc --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier-u.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."; + +/(?