mirror of
https://github.com/tc39/test262.git
synced 2025-05-19 06:10:28 +02:00
split non-unicode-malformed.js
This commit is contained in:
parent
69c1efd325
commit
de339e98d6
@ -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>.)/"));
|
@ -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>/;
|
@ -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)/;
|
@ -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>/;
|
@ -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)/;
|
@ -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>.)\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<>/;
|
@ -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/;
|
@ -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)/;
|
@ -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)/;
|
@ -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)/;
|
Loading…
x
Reference in New Issue
Block a user