mirror of https://github.com/tc39/test262.git
split unicode-malformed.js
This commit is contained in:
parent
296f47a008
commit
9bc9116656
|
@ -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");
|
||||
|
|
@ -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.";
|
||||
|
||||
/(?<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.";
|
||||
|
||||
/\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.";
|
||||
|
||||
/(?<a>.)\k<b>/u;
|
|
@ -17,4 +17,4 @@ features: [regexp-named-groups]
|
|||
|
||||
throw "Test262: This statement should not be evaluated.";
|
||||
|
||||
/\k<a>(?<b>x)/;
|
||||
/\k<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)/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)/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: 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<>/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/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: 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.";
|
||||
|
||||
/(?<: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)/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)/u;
|
Loading…
Reference in New Issue