Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(678)

Unified Diff: test/mjsunit/harmony/regexp-named-captures.js

Issue 2839923002: [regexp] Fix unicode escapes in test strings (Closed)
Patch Set: Add tests for non-bracketed escapes Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/regexp-named-captures.js
diff --git a/test/mjsunit/harmony/regexp-named-captures.js b/test/mjsunit/harmony/regexp-named-captures.js
index 42dbe0f74feda70a6a77ec727a691a92eb88c6fc..4658af24be36effc5ca509f29db05c9e9ae31cad 100644
--- a/test/mjsunit/harmony/regexp-named-captures.js
+++ b/test/mjsunit/harmony/regexp-named-captures.js
@@ -195,10 +195,15 @@ assertTrue(/(?<\u0041>.)/u.test("a")); // \u NonSurrogate
assertTrue(/(?<\u{0041}>.)/u.test("a")); // \u{ Non-surrogate }
assertTrue(/(?<a\u{104A4}>.)/u.test("a")); // \u{ Surrogate, ID_Continue }
assertThrows("/(?<a\\u{110000}>.)/u", SyntaxError); // \u{ Out-of-bounds }
+assertThrows("/(?<a\\uD801>.)/u", SyntaxError); // Lead
+assertThrows("/(?<a\\uDCA4>.)/u", SyntaxError); // Trail
assertThrows("/(?<a\uD801>.)/u", SyntaxError); // Lead
assertThrows("/(?<a\uDCA4>.)/u", SyntaxError); // Trail
+assertTrue(RegExp("(?<\\u{0041}>.)", "u").test("a")); // Non-surrogate
+assertTrue(RegExp("(?<a\\u{104A4}>.)", "u").test("a")); // Surrogate,ID_Continue
assertTrue(RegExp("(?<\u{0041}>.)", "u").test("a")); // Non-surrogate
assertTrue(RegExp("(?<a\u{104A4}>.)", "u").test("a")); // Surrogate,ID_Continue
+assertTrue(RegExp("(?<\\u0041>.)", "u").test("a")); // Non-surrogate
assertThrows("/(?<a\\uD801\uDCA4>.)/", SyntaxError);
assertThrows("/(?<a\\uD801>.)/", SyntaxError);
@@ -207,10 +212,15 @@ assertTrue(/(?<\u0041>.)/.test("a"));
assertThrows("/(?<\\u{0041}>.)/", SyntaxError);
assertThrows("/(?<a\\u{104A4}>.)/", SyntaxError);
assertThrows("/(?<a\\u{10FFFF}>.)/", SyntaxError);
+assertThrows("/(?<a\\uD801>.)/", SyntaxError); // Lead
+assertThrows("/(?<a\\uDCA4>.)/", SyntaxError); // Trail;
assertThrows("/(?<a\uD801>.)/", SyntaxError); // Lead
assertThrows("/(?<a\uDCA4>.)/", SyntaxError); // Trail
+assertThrows("/(?<\\u{0041}>.)/", SyntaxError); // Non-surrogate
+assertThrows("/(?<a\\u{104A4}>.)/", SyntaxError); // Surrogate, ID_Continue
assertTrue(RegExp("(?<\u{0041}>.)").test("a")); // Non-surrogate
assertTrue(RegExp("(?<a\u{104A4}>.)").test("a")); // Surrogate, ID_Continue
+assertTrue(RegExp("(?<\\u0041>.)").test("a")); // Non-surrogate
// @@replace with a callable replacement argument (no named captures).
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698