diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-28 07:21:50 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-28 07:21:50 +0000 |
commit | f841d3a6c1ab928bc8aeb7c7ed1526bd81a60edb (patch) | |
tree | 0767b0c7acbf97da0be1683d5f7ef189ad585615 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 85693aeb436f6b9b43b4913bbfe557c74a494f9d (diff) | |
download | bcm5719-llvm-f841d3a6c1ab928bc8aeb7c7ed1526bd81a60edb.tar.gz bcm5719-llvm-f841d3a6c1ab928bc8aeb7c7ed1526bd81a60edb.zip |
clang-format: Lower binding strengths created by the [] created by ObjC
method expressions and array literals. They should not bind stronger
than regular parentheses or the braces of braced lists.
Specific test case in JavaScript:
Before:
var aaaaa: List<
SomeThing> = [new SomeThingAAAAAAAAAAAA(), new SomeThingBBBBBBBBB()];
After:
var aaaaa: List<SomeThing> = [
new SomeThingAAAAAAAAAAAA(),
new SomeThingBBBBBBBBB()
];
llvm-svn: 238400
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index a06daac24ec..a536926c73c 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -239,6 +239,13 @@ TEST_F(FormatTestJS, FormatsFreestandingFunctions) { "}"); } +TEST_F(FormatTestJS, ArrayLiterals) { + verifyFormat("var aaaaa: List<SomeThing> = [\n" + " new SomeThingAAAAAAAAAAAA(),\n" + " new SomeThingBBBBBBBBB()\n" + "];"); +} + TEST_F(FormatTestJS, FunctionLiterals) { verifyFormat("doFoo(function() {});"); verifyFormat("doFoo(function() { return 1; });"); |