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 5c9c131a4857aec2ff24b9f1d580b4d218c87cdb..0000000000000000000000000000000000000000 --- 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("/(?<aa)/u"), "Unterminated name"); -assert.throws(SyntaxError, () => 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:>a)/u"), "Name containing with invalid char"); -assert.throws(SyntaxError, () => eval("/(?<a>a)(?<a>a)/u"), "Duplicate name"); -assert.throws(SyntaxError, () => eval("/(?<a>a)(?<b>b)(?<a>a)/u"), "Duplicate name"); -assert.throws(SyntaxError, () => eval("/\\k<a>/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/\\k<a/u"), "Unterminated reference"); -assert.throws(SyntaxError, () => eval("/\\k<>/u"), "Empty reference"); -assert.throws(SyntaxError, () => eval("/\\k/u"), "Lone \k"); -assert.throws(SyntaxError, () => eval("/(?<a>.)\\k/u"), "Lone \k"); -assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<a/u"), "Unterminated reference"); -assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<>/u"), "Empty reference"); -assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<b>/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?<a>a)\\k<ab>/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?<ab>a)\\k<a>/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/\\k<a>(?<ab>a)/u"), "Invalid reference"); -assert.throws(SyntaxError, () => eval("/(?<a>\\a)/u"), "Identity escape in capture"); - 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 0000000000000000000000000000000000000000..264709e7d98316bed4bcb528308353b5df933890 --- /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>a)\k<ab>/u; 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 0000000000000000000000000000000000000000..b0690b51679191580fc10dceeb44c87680576a07 --- /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."; + +/(?<ab>a)\k<a>/u; 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 0000000000000000000000000000000000000000..fecebf654e2d78d605bad804b404b1218f206604 --- /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>(?<ab>a)/u; 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 0000000000000000000000000000000000000000..dd14be10abaa1d4a2df32b2cc685f7b9d7c19718 --- /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."; + +/(?<a>.)\k<b>/u; diff --git a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js similarity index 97% rename from test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js rename to test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js index 582bf29d8a4d17492c77eec19ea2d43fd89459a0..004618ede4a1e718e513a9c77935de83b5260644 100644 --- a/test/language/literals/regexp/named-groups/invalid-dangling-groupname-5.js +++ b/test/language/literals/regexp/named-groups/invalid-dangling-groupname-without-group-u.js @@ -17,4 +17,4 @@ features: [regexp-named-groups] throw "Test262: This statement should not be evaluated."; -/\k<a>(?<b>x)/; +/\k<a>/u; 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 0000000000000000000000000000000000000000..70707a499fc432a22ba6d64123b2c06025c166dd --- /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>a)(?<b>b)(?<a>a)/u; 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 0000000000000000000000000000000000000000..bac92214902c96a082a73e31f057c9630f29d8bd --- /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)(?<a>a)/u; 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 0000000000000000000000000000000000000000..44a86c1c5a57f4933c76b1203a916be4b747aa36 --- /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-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 0000000000000000000000000000000000000000..0f46b0e1dcef6604bcddee64401e172d42eefb13 --- /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>\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 0000000000000000000000000000000000000000..ed0d2ff0197139902347c13c9f5ed3d62a09f391 --- /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."; + +/(?<a>.)\k<a/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-3-u.js new file mode 100644 index 0000000000000000000000000000000000000000..883c3b0d8d7cbb5bf3bf28edfc5a7a7325372c7f --- /dev/null +++ b/test/language/literals/regexp/named-groups/invalid-incomplete-groupname-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."; + +/(?<a>.)\k<>/u; 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 0000000000000000000000000000000000000000..636b69a5788cac3ab9c73747e184b6ea31aaecaa --- /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."; + +/(?<a>.)\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 0000000000000000000000000000000000000000..d953a4287724c2ea43902afc7fd0f2a9f1591ad6 --- /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 0000000000000000000000000000000000000000..f8c41abbfec67b7593251a78581faf11133c930b --- /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 0000000000000000000000000000000000000000..b7e22617e6ffeaa0f5dd958f941f322b980d10b4 --- /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<a/u; 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 0000000000000000000000000000000000000000..c5ede73e6f9942cb135c2ea9fe2296499b28bb32 --- /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-punctuator-starting-groupspecifier-u.js b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier-u.js new file mode 100644 index 0000000000000000000000000000000000000000..b55f2b5453486179edc535492e4aafda831b36c7 --- /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-in-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js similarity index 100% rename from test/language/literals/regexp/named-groups/invalid-punctuator-in-groupspecifier.js rename to test/language/literals/regexp/named-groups/invalid-punctuator-starting-groupspecifier.js 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 0000000000000000000000000000000000000000..1419cddb5f41eb0523a9d5935a2fba960c276245 --- /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:>a)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-punctuator-in-groupspecifier-2.js b/test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js similarity index 100% rename from test/language/literals/regexp/named-groups/invalid-punctuator-in-groupspecifier-2.js rename to test/language/literals/regexp/named-groups/invalid-punctuator-within-groupspecifier.js 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 0000000000000000000000000000000000000000..d84c30e4dc1d9d63e307f6e3723344c94d5759d1 --- /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."; + +/(?<aa)/u; diff --git a/test/language/literals/regexp/named-groups/invalid-incomplete-groupspecifier.js b/test/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js similarity index 100% rename from test/language/literals/regexp/named-groups/invalid-incomplete-groupspecifier.js rename to test/language/literals/regexp/named-groups/invalid-unterminated-groupspecifier.js