Index: test/cctest/test-parsing.cc |
diff --git a/test/cctest/test-parsing.cc b/test/cctest/test-parsing.cc |
index 85b2f3c4002c50a051d6604f59b968be6cba0fd2..22d5056f8007c4afa1ae0f95cc813d3f22133e6c 100644 |
--- a/test/cctest/test-parsing.cc |
+++ b/test/cctest/test-parsing.cc |
@@ -1977,3 +1977,39 @@ TEST(FunctionDeclaresItselfStrict) { |
RunParserSyncTest(context_data, strict_statement_data, kError); |
RunParserSyncTest(context_data, non_strict_statement_data, kSuccess); |
} |
+ |
+ |
+TEST(ErrorsTryWithoutCatchOrFinally) { |
+ const char* context_data[][2] = { |
+ {"", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "try { }", |
+ "try { } foo();", |
+ "try { } catch (e) foo();", |
+ "try { } catch { }", |
+ "try { } finally foo();", |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kError); |
+} |
+ |
+ |
+TEST(NoErrorsTryCatchFinally) { |
+ const char* context_data[][2] = { |
+ {"", ""}, |
+ { NULL, NULL } |
+ }; |
+ |
+ const char* statement_data[] = { |
+ "try { } catch (e) { }", |
+ "try { } catch (e) { } finally { }", |
+ "try { } finally { }", |
+ NULL |
+ }; |
+ |
+ RunParserSyncTest(context_data, statement_data, kSuccess); |
+} |