clang-format: [JS] support optionality markers in JS types.
Patch by Martin Probst. Thank you.
llvm-svn: 234753
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index bfe62ec..eb587f2 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -662,5 +662,13 @@
verifyFormat("class C extends D<E> implements F<G>, H<I> {}");
}
+TEST_F(FormatTestJS, OptionalTypes) {
+ verifyFormat("function x(a?: b, c?, d?) {\n}");
+ verifyFormat("class X {\n"
+ " y?: z;\n"
+ " z?;\n"
+ "}");
+}
+
} // end namespace tooling
} // end namespace clang