diff options
author | Daniel Jasper <djasper@google.com> | 2016-02-11 13:24:15 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2016-02-11 13:24:15 +0000 |
commit | b7fda11572dd4b3aad889743cd790565e1ccd43d (patch) | |
tree | 474814a29c60aaacc393a59951c1bbb0c9654331 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 602a727adda6c96c89d4d68d8f76d0e724a3b56d (diff) | |
download | bcm5719-llvm-b7fda11572dd4b3aad889743cd790565e1ccd43d.tar.gz bcm5719-llvm-b7fda11572dd4b3aad889743cd790565e1ccd43d.zip |
clang-format: [JS] Support for (.. of ..) loops.
Before:
for (var i of[2, 3]) {}
After:
for (var i of [2, 3]) {}
llvm-svn: 260518
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 7fad83aab12..e08c876a5c6 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -595,6 +595,8 @@ TEST_F(FormatTestJS, ReturnStatements) { TEST_F(FormatTestJS, ForLoops) { verifyFormat("for (var i in [2, 3]) {\n" "}"); + verifyFormat("for (var i of [2, 3]) {\n" + "}"); } TEST_F(FormatTestJS, AutomaticSemicolonInsertion) { @@ -758,6 +760,7 @@ TEST_F(FormatTestJS, TypeAnnotations) { verifyFormat("function x(): {x: string} {\n return {x: 'x'};\n}"); verifyFormat("function x(y: string): string {\n return 'x';\n}"); verifyFormat("for (var y: string in x) {\n x();\n}"); + verifyFormat("for (var y: string of x) {\n x();\n}"); verifyFormat("function x(y: {a?: number;} = {}): number {\n" " return 12;\n" "}"); |