clang-format: [JS] support free-standing functions again.
authorDaniel Jasper <djasper@google.com>
Mon, 30 Jun 2014 13:24:54 +0000 (13:24 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 30 Jun 2014 13:24:54 +0000 (13:24 +0000)
commitad9eb0d79decb3c875073f625a38aee2df3d94b3
tree94fbba7a1e570f32982b5210819386c24b6f211b
parent93a68fb0c7e69027d59a35759c57deb8a8dae4e3
clang-format: [JS] support free-standing functions again.

This worked initially but was broken by r210887.

Before:
  function outer1(a, b) {
    function inner1(a, b) { return a; } inner1(a, b);
  } function outer2(a, b) { function inner2(a, b) { return a; } inner2(a, b); }

After:
  function outer1(a, b) {
    function inner1(a, b) { return a; }
    inner1(a, b);
  }
  function outer2(a, b) {
    function inner2(a, b) { return a; }
    inner2(a, b);
  }

Thanks to Adam Strzelecki for working on this.

llvm-svn: 212038
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTestJS.cpp