mirror of https://github.com/tc39/test262.git
Merge pull request #1923 from bakkot/less-regex-eval
Reduce uses of `eval` for regex literal syntax
This commit is contained in:
commit
b1e15cd326
|
@ -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("/(?<aa)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<42a>a)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<:a>a)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a:>a)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>a)(?<a>a)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>a)(?<b>b)(?<a>a)/"));
|
|
||||||
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>.)\\k/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<a/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<>/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>.)\\k<b>/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a>a)\\k<ab>/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<ab>a)\\k<a>/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/\\k<a>(?<ab>a)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/\\k<a(?<a>a)/"));
|
|
||||||
|
|
||||||
// A couple of corner cases around '\k' as named back-references vs. identity
|
|
||||||
// escapes.
|
|
||||||
assert(/\k<a>(?<a>x)/.test("x"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/\\k<a>(?<b>x)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/\\k<a(?<a>.)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/\\k(?<a>.)/"));
|
|
|
@ -5,40 +5,19 @@
|
||||||
description: Exotic named group names in non-Unicode RegExps
|
description: Exotic named group names in non-Unicode RegExps
|
||||||
esid: prod-GroupSpecifier
|
esid: prod-GroupSpecifier
|
||||||
features: [regexp-named-groups]
|
features: [regexp-named-groups]
|
||||||
includes: [compareArray.js]
|
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
assert.sameValue("a", /(?<π>a)/.exec("bab").groups.π);
|
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.\u03C0);
|
||||||
assert.sameValue("a", /(?<$>a)/.exec("bab").groups.$);
|
assert.sameValue("a", /(?<$>a)/.exec("bab").groups.$);
|
||||||
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", /(?<_\u200C>a)/.exec("bab").groups._\u200C);
|
||||||
assert.sameValue("a", /(?<_\u200D>a)/.exec("bab").groups._\u200D);
|
assert.sameValue("a", /(?<_\u200D>a)/.exec("bab").groups._\u200D);
|
||||||
assert.sameValue("a", /(?<ಠ_ಠ>a)/.exec("bab").groups.ಠ_ಠ);
|
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.
|
// Unicode escapes in capture names.
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uD801\uDCA4>.)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uD801>.)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/"));
|
|
||||||
assert(/(?<\u0041>.)/.test("a"));
|
assert(/(?<\u0041>.)/.test("a"));
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\u{104A4}>.)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\u{10FFFF}>.)/"));
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/"), "Lea");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/"), "Trai");
|
|
||||||
assert(RegExp("(?<\u{0041}>.)").test("a"), "Non-surrogate");
|
assert(RegExp("(?<\u{0041}>.)").test("a"), "Non-surrogate");
|
||||||
|
|
||||||
// Bracketed escapes are not allowed;
|
|
||||||
// 4-char escapes must be the proper ID_Start/ID_Continue
|
// 4-char escapes must be the proper ID_Start/ID_Continue
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uD801>.)/"), "Lead");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/"), "Trail");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<\\u{0041}>.)/"), "Non-surrogate");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\u{104A4}>.)/"), "Surrogate, ID_Continue");
|
|
||||||
assert(RegExp("(?<\\u0041>.)").test("a"), "Non-surrogate");
|
assert(RegExp("(?<\\u0041>.)").test("a"), "Non-surrogate");
|
||||||
|
|
||||||
// Backslash is not allowed as ID_Start and ID_Continue
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<\\>.)/"), "'\' misclassified as ID_Start");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\>.)/"), "'\' misclassified as ID_Continue");
|
|
||||||
|
|
|
@ -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");
|
|
||||||
|
|
|
@ -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", /(?<_\u200C>a)/u.exec("bab").groups._\u200C);
|
||||||
assert.sameValue("a", /(?<_\u200D>a)/u.exec("bab").groups._\u200D);
|
assert.sameValue("a", /(?<_\u200D>a)/u.exec("bab").groups._\u200D);
|
||||||
assert.sameValue("a", /(?<ಠ_ಠ>a)/u.exec("bab").groups.ಠ_ಠ);
|
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.
|
// Unicode escapes in capture names.
|
||||||
assert(/(?<a\uD801\uDCA4>.)/u.test("a"), "\\u Lead \\u Trail");
|
assert(/(?<a\uD801\uDCA4>.)/u.test("a"), "\\u Lead \\u Trail");
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uD801>.)/u"), "\\u Lea");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/u"), "\\u Trai");
|
|
||||||
assert(/(?<\u0041>.)/u.test("a"), "\\u NonSurrogate");
|
assert(/(?<\u0041>.)/u.test("a"), "\\u NonSurrogate");
|
||||||
assert(/(?<\u{0041}>.)/u.test("a"), "\\u{ Non-surrogate }");
|
assert(/(?<\u{0041}>.)/u.test("a"), "\\u{ Non-surrogate }");
|
||||||
assert(/(?<a\u{104A4}>.)/u.test("a"), "\\u{ Surrogate, ID_Continue }");
|
assert(/(?<a\u{104A4}>.)/u.test("a"), "\\u{ Surrogate, ID_Continue }");
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\u{110000}>.)/u"), "\\u{ Out-of-bounds ");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\uD801>.)/u"), "Lea");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\uDCA4>.)/u"), "Trai");
|
|
||||||
assert(RegExp("(?<\u{0041}>.)", "u").test("a"), "Non-surrogate");
|
assert(RegExp("(?<\u{0041}>.)", "u").test("a"), "Non-surrogate");
|
||||||
assert(RegExp("(?<a\u{104A4}>.)", "u").test("a"), "Surrogate,ID_Continue");
|
assert(RegExp("(?<a\u{104A4}>.)", "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("/(?<a\\uD801>.)/u"), "Lead");
|
|
||||||
assert.throws(SyntaxError, () => eval("/(?<a\\uDCA4>.)/u"), "Trail");
|
|
||||||
assert((/(?<\u{0041}>.)/u).test("a"), "Non-surrogate");
|
assert((/(?<\u{0041}>.)/u).test("a"), "Non-surrogate");
|
||||||
assert(/(?<a\u{104A4}>.)/u.test("a"), "Surrogate, ID_Continue");
|
assert(/(?<a\u{104A4}>.)/u.test("a"), "Surrogate, ID_Continue");
|
||||||
assert(RegExp("(?<\\u0041>.)", "u").test("a"), "Non-surrogate");
|
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("/(?<a\\>.)/u"), "'\' misclassified as ID_Continue");
|
|
||||||
|
|
|
@ -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<a>(?<a>x)/.test("x"));
|
|
@ -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;
|
|
@ -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>/;
|
|
@ -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;
|
|
@ -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>/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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>(?<b>x)/;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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>/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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/;
|
|
@ -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;
|
|
@ -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<>/;
|
|
@ -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(?<a>a)/;
|
|
@ -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(?<a>.)/;
|
|
@ -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>.)/;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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;
|
|
@ -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/;
|
|
@ -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("/(?<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");
|
|
@ -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;
|
|
@ -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\>.)/;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\uD801\uDCA4>.)/;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\uD801>.)/u;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\uD801>.)/;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\uDCA4>.)/u;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\uDCA4>.)/;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\u{104A4}>.)/;
|
|
@ -0,0 +1,15 @@
|
||||||
|
// Copyright 2017 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
|
/*---
|
||||||
|
description: GroupSpecifier must be identifier-like.
|
||||||
|
esid: prod-GroupSpecifier
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [regexp-named-groups]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
throw "Test262: This statement should not be evaluated.";
|
||||||
|
|
||||||
|
/(?<a\u{10FFFF}>.)/;
|
|
@ -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;
|
|
@ -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.";
|
||||||
|
|
||||||
|
/(?<\>.)/;
|
|
@ -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{110000}>.)/u;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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;
|
|
@ -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)/;
|
|
@ -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)/;
|
|
@ -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}>.)/;
|
|
@ -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;
|
|
@ -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)/;
|
Loading…
Reference in New Issue