diff options
author | Martin Probst <martin@probst.io> | 2017-11-25 09:24:33 +0000 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2017-11-25 09:24:33 +0000 |
commit | 525eeeae5f1af0017fdafe109cfde6d49ab0c4b2 (patch) | |
tree | 39e65e14e12f5a1b5a050ffd5c54a07eeab0ee59 /unittests | |
parent | 47e4a29e874ca493876a9cfbf6eea8c457eb919e (diff) |
clang-format: [JS] handle `for` as object label.
Summary: Previously, clang-format would fail formatting `{for: 1}`.
Reviewers: djasper
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D40441
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318974 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests')
-rw-r--r-- | unittests/Format/FormatTestJS.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/unittests/Format/FormatTestJS.cpp b/unittests/Format/FormatTestJS.cpp index 97ec843a56..cfdd4b375b 100644 --- a/unittests/Format/FormatTestJS.cpp +++ b/unittests/Format/FormatTestJS.cpp @@ -323,6 +323,11 @@ TEST_F(FormatTestJS, ReservedWords) { " case: string;\n" " default: string;\n" "}\n"); + verifyFormat("const Axis = {\n" + " for: 'for',\n" + " x: 'x'\n" + "};", + "const Axis = {for: 'for', x: 'x'};"); } TEST_F(FormatTestJS, ReservedWordsMethods) { |