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

Unified Diff: test/mjsunit/harmony/unicode-regexp-restricted-syntax.js

Issue 1681893002: [regexp] parse RegExpUnicodeEscapeSequence according to spec. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix: /[\00]/u is not allowed. Created 4 years, 10 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
Index: test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
diff --git a/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js b/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
index 8c2de8dfa6f0483d4f33c9fddf855238898e508e..76d0539e48160fec7a16a296f5364832c5e5646c 100644
--- a/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
+++ b/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
@@ -32,3 +32,13 @@ assertThrows("/}/u");
assertThrows("/]/u");
// test262/built-ins/RegExp/unicode_identity_escape
/\//u;
+
+// escaped \0 is allowed inside a character class.
+assertEquals(["\0"], /[\0]/u.exec("\0"));
+// unless it is followed by another digit.
+assertThrows("/[\\00]/u");
+assertThrows("/[\\01]/u");
+assertThrows("/[\\09]/u");
+assertEquals(["\u{0}1\u{0}a\u{0}"], /[1\0a]+/u.exec("b\u{0}1\u{0}a\u{0}2"));
+// escaped \- is allowed inside a character class.
+assertEquals(["-"], /[a\-z]/u.exec("12-34"));
« src/regexp/regexp-parser.cc ('K') | « test/mjsunit/harmony/unicode-escapes-in-regexps.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698