clang-format: Fixed formatting of JavaScript container literals

Before:
  var arr = [ 1, 2, 3 ];
  var obj = {a : 1, b : 2, c : 3};

After:
  var arr = [1, 2, 3];
  var obj = {a: 1, b: 2, c: 3};

llvm-svn: 199317
diff --git a/clang/unittests/Format/FormatTest.cpp b/clang/unittests/Format/FormatTest.cpp
index 33cc7eb..32e7070 100644
--- a/clang/unittests/Format/FormatTest.cpp
+++ b/clang/unittests/Format/FormatTest.cpp
@@ -7321,6 +7321,7 @@
   CHECK_PARSE_BOOL(SpacesInParentheses);
   CHECK_PARSE_BOOL(SpacesInAngles);
   CHECK_PARSE_BOOL(SpaceInEmptyParentheses);
+  CHECK_PARSE_BOOL(SpacesInContainerLiterals);
   CHECK_PARSE_BOOL(SpacesInCStyleCastParentheses);
   CHECK_PARSE_BOOL(SpaceBeforeAssignmentOperators);
 
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index 07969d2..08969ff 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -79,5 +79,10 @@
                getGoogleJSStyleWithColumns(20));
 }
 
+TEST_F(FormatTestJS, SpacesInContainerLiterals) {
+  verifyFormat("var arr = [1, 2, 3];");
+  verifyFormat("var obj = {a: 1, b: 2, c: 3};");
+}
+
 } // end namespace tooling
 } // end namespace clang