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

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

Issue 2795093003: [regexp] Disallow '\' in capture names (Closed)
Patch Set: Also fix ID_Continue 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 | « src/regexp/regexp-parser.cc ('k') | 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 9d6b9a95c7e0909e0cee0e27730e09c6be4d6520..b31eb3cee6c8909667e0ee37071283a780ae6633 100644
--- a/test/mjsunit/harmony/regexp-named-captures.js
+++ b/test/mjsunit/harmony/regexp-named-captures.js
@@ -177,6 +177,10 @@ assertEquals(["fst", "snd"],
assertEquals(undefined, /(?<a>.)/u.exec("a").groups.__proto__);
assertEquals("a", /(?<__proto__>a)/u.exec("a").groups.__proto__);
+// Backslash as ID_Start and ID_Continue (v8:5868).
+assertThrows("/(?<\\>.)/", SyntaxError); // '\' misclassified as ID_Start.
+assertThrows("/(?<a\\>.)/", SyntaxError); // '\' misclassified as ID_Continue.
+
// Backreference before the group (exercises the capture mini-parser).
assertThrows("/\\1(?:.)/u", SyntaxError);
assertThrows("/\\1(?<=a)./u", SyntaxError);
« no previous file with comments | « src/regexp/regexp-parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698