clang-format: Fix incorrect indentation.
Before (JavaScript example, but can extend to other languages):
return {
a: 'E',
b: function() {
return function() {
f(); // This is wrong.
};
}
};
After:
return {
a: 'E',
b: function() {
return function() {
f(); // This is better.
};
}
};
llvm-svn: 210334
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index ddd594b..50fef8d 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -137,6 +137,14 @@
" foo();\n"
" bar();\n"
"}, this);");
+ verifyFormat("return {\n"
+ " a: 'E',\n"
+ " b: function() {\n"
+ " return function() {\n"
+ " f(); //\n"
+ " };\n"
+ " }\n"
+ "};");
verifyFormat("var x = {a: function() { return 1; }};",
getGoogleJSStyleWithColumns(38));