clang-format: Initial support for try-catch.
Most of this patch was created by Alexander Rojas in
http://reviews.llvm.org/D2555
Thank you!
Synced and addressed review comments.
llvm-svn: 208302
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 2dfd10f..73e050d 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -118,6 +118,16 @@
verifyFormat("var x = /** @type {foo} */ (bar);");
}
+TEST_F(FormatTestJS, TryCatch) {
+ verifyFormat("try {\n"
+ " f();\n"
+ "} catch (e) {\n"
+ " g();\n"
+ "} finally {\n"
+ " h();\n"
+ "}");
+}
+
TEST_F(FormatTestJS, RegexLiteralClassification) {
// Regex literals.
verifyFormat("var regex = /abc/;");