From ebcb71fb875647de31cc0de5b446b72703a212bb Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 4 Jan 2016 13:11:41 +0000 Subject: clang-format: [JS] Improve empty array literal detection. Previously, the [] in the following example were recognized as an array subscript leading to weird indentation. Before: var aaaa = aaaaa || // wrap []; After: var aaaa = aaaaa || // wrap []; llvm-svn: 256753 --- clang/unittests/Format/FormatTestJS.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/unittests/Format/FormatTestJS.cpp') diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index cba2ce3370c..d42eed6048f 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -310,6 +310,8 @@ TEST_F(FormatTestJS, ArrayLiterals) { " ccccccccccccccccccccccccccc\n" " ],\n" " aaaa);"); + verifyFormat("var aaaa = aaaaa || // wrap\n" + " [];"); verifyFormat("someFunction([], {a: a});"); } -- cgit v1.2.3