Skip to content
Snippets Groups Projects
Commit 0160cab5 authored by Kevin Gibbons's avatar Kevin Gibbons
Browse files

fix missing/duplicate tests

parent e80d8a18
No related branches found
No related tags found
No related merge requests found
...@@ -23,6 +23,8 @@ assert(/(?<a\uD801\uDCA4>.)/u.test("a"), "\\u Lead \\u Trail"); ...@@ -23,6 +23,8 @@ assert(/(?<a\uD801\uDCA4>.)/u.test("a"), "\\u Lead \\u Trail");
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(RegExp("(?<\u{0041}>.)", "u").test("a"), "Non-surrogate");
assert(RegExp("(?<a\u{104A4}>.)", "u").test("a"), "Surrogate,ID_Continue");
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");
...@@ -2,8 +2,13 @@ ...@@ -2,8 +2,13 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
description: GroupSpecifier must be identifier-like. description: Group reference must have corresponding group.
esid: prod-GroupSpecifier 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: negative:
phase: parse phase: parse
type: SyntaxError type: SyntaxError
...@@ -12,4 +17,4 @@ features: [regexp-named-groups] ...@@ -12,4 +17,4 @@ features: [regexp-named-groups]
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
/(?<a\uDCA4>.)/; /\k<a>(?<b>x)/;
// 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");
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// This code is governed by the BSD license found in the LICENSE file. // This code is governed by the BSD license found in the LICENSE file.
/*--- /*---
description: GroupSpecifier must be identifier-like. description: \u{} escapes in GroupSpecifier allowed only in Unicode mode
esid: prod-GroupSpecifier esid: prod-GroupSpecifier
negative: negative:
phase: parse phase: parse
...@@ -12,4 +12,4 @@ features: [regexp-named-groups] ...@@ -12,4 +12,4 @@ features: [regexp-named-groups]
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
/(?<a\uD801>.)/; /(?<\u{03C0}>a)/;
...@@ -12,4 +12,4 @@ features: [regexp-named-groups] ...@@ -12,4 +12,4 @@ features: [regexp-named-groups]
throw "Test262: This statement should not be evaluated."; throw "Test262: This statement should not be evaluated.";
/(?<\u{0041}>a)/; /(?<\u{0041}>.)/;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment