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

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: addressed comments 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
« no previous file with comments | « test/mjsunit/harmony/unicode-escapes-in-regexps.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d129cc340eb5c7ca32bcbd34da5500938650172f 100644
--- a/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
+++ b/test/mjsunit/harmony/unicode-regexp-restricted-syntax.js
@@ -5,30 +5,40 @@
// Flags: --harmony-unicode-regexps
// test262/data/test/language/literals/regexp/u-dec-esc
-assertThrows("/\\1/u");
+assertThrows("/\\1/u", SyntaxError);
// test262/language/literals/regexp/u-invalid-char-range-a
-assertThrows("/[\\w-a]/u");
+assertThrows("/[\\w-a]/u", SyntaxError);
// test262/language/literals/regexp/u-invalid-char-range-b
-assertThrows("/[a-\\w]/u");
+assertThrows("/[a-\\w]/u", SyntaxError);
// test262/language/literals/regexp/u-invalid-char-esc
-assertThrows("/\\c/u");
-assertThrows("/\\c0/u");
+assertThrows("/\\c/u", SyntaxError);
+assertThrows("/\\c0/u", SyntaxError);
// test262/built-ins/RegExp/unicode_restricted_quantifiable_assertion
-assertThrows("/(?=.)*/u");
+assertThrows("/(?=.)*/u", SyntaxError);
// test262/built-ins/RegExp/unicode_restricted_octal_escape
-assertThrows("/[\\1]/u");
-assertThrows("/\\00/u");
-assertThrows("/\\09/u");
+assertThrows("/[\\1]/u", SyntaxError);
+assertThrows("/\\00/u", SyntaxError);
+assertThrows("/\\09/u", SyntaxError);
// test262/built-ins/RegExp/unicode_restricted_identity_escape_alpha
-assertThrows("/[\\c]/u");
+assertThrows("/[\\c]/u", SyntaxError);
// test262/built-ins/RegExp/unicode_restricted_identity_escape_c
-assertThrows("/[\\c0]/u");
+assertThrows("/[\\c0]/u", SyntaxError);
// test262/built-ins/RegExp/unicode_restricted_incomple_quantifier
-assertThrows("/a{/u");
-assertThrows("/a{1,/u");
-assertThrows("/{/u");
-assertThrows("/}/u");
+assertThrows("/a{/u", SyntaxError);
+assertThrows("/a{1,/u", SyntaxError);
+assertThrows("/{/u", SyntaxError);
+assertThrows("/}/u", SyntaxError);
// test262/data/test/built-ins/RegExp/unicode_restricted_brackets
-assertThrows("/]/u");
+assertThrows("/]/u", SyntaxError);
// 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", SyntaxError);
+assertThrows("/[\\01]/u", SyntaxError);
+assertThrows("/[\\09]/u", SyntaxError);
+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"));
« no previous file with comments | « 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