Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index bc12153729c622cf8ad031f2ae486a679949368a..5eb675020d6c70e40a73dab2d99817bdc33ea344 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -7982,3 +7982,25 @@ TEST(MiscSyntaxErrors) { |
RunParserSyncTest(context_data, error_data, kError, NULL, 0, NULL, 0); |
} |
+ |
+TEST(PatternSyntaxError) { |
+ v8::V8::Initialize(); |
+ v8::HandleScope scope(CcTest::isolate()); |
+ v8::Context::Scope context_scope(v8::Context::New(CcTest::isolate())); |
+ |
+ const char* sources[] = { |
+ // crbug.com/582626 |
+ "{ NaN ,chA((evarA=new t ( l = !.0[((... co -a0([1]))=> greturnkf", |
+ |
+ // Simplified case: |
+ "(...rest - a) => b", |
+ }; |
+ |
+ for (int i = 0; i < arraysize(sources); i++) { |
+ v8::TryCatch try_catch(CcTest::isolate()); |
+ v8_compile(v8_str(sources[i])); |
+ CHECK(try_catch.HasCaught()); |
+ v8::String::Utf8Value exception(try_catch.Exception()); |
+ CHECK_EQ(0, strcmp("SyntaxError: Not supported", *exception)); |
+ } |
+} |