Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index f3f238caa965dd9f34904ce514092426256336f1..3d8fc39fcc2d26c828ecc393217c73d1ca33a4eb 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -2014,3 +2014,35 @@ TEST(NoErrorsTryCatchFinally) { |
RunParserSyncTest(context_data, statement_data, kSuccess); |
} |
+ |
+ |
+TEST(ErrorsRegexpLiteral) { |
+ const char* context_data[][2] = { |
+ {"var r = ", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "/unterminated", |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kError); |
+} |
+ |
+ |
+TEST(NoErrorsRegexpLiteral) { |
+ const char* context_data[][2] = { |
+ {"var r = ", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "/foo/", |
+ "/foo/g", |
+ "/foo/whatever", // This is an error but not detected by the parser. |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kSuccess); |
+} |