diff options
author | Daniel Jasper <djasper@google.com> | 2015-06-12 04:52:02 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-06-12 04:52:02 +0000 |
commit | 910807d4b9ee588e51e34ccb7804758123a78423 (patch) | |
tree | b4903a581a515dea1c8ff1ce36b299e7ae17bc12 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 9c39f83f80e58fb288344d0186752de0f6a98110 (diff) | |
download | bcm5719-llvm-910807d4b9ee588e51e34ccb7804758123a78423.tar.gz bcm5719-llvm-910807d4b9ee588e51e34ccb7804758123a78423.zip |
clang-format: [JS] fix incorrectly collapsed lines after export
statement.
When an exported function would follow a class declaration, it would not
be recognized as a stand-alone function. That would then collapse the
following line with the current one, e.g.
class C {}
export function f() {} var x;
llvm-svn: 239592
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index 8f7202eeb20..e01637bfad4 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -726,6 +726,9 @@ TEST_F(FormatTestJS, Modules) { verifyFormat("export default class X { y: number }"); verifyFormat("export default function() {\n return 1;\n}"); verifyFormat("export var x = 12;"); + verifyFormat("class C {}\n" + "export function f() {}\n" + "var v;"); verifyFormat("export var x: number = 12;"); verifyFormat("export const y = {\n" " a: 1,\n" |