diff options
author | Daniel Jasper <djasper@google.com> | 2015-05-29 06:19:49 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2015-05-29 06:19:49 +0000 |
commit | 8c42d445e35bcb5a6ea39972757f298b9cf2f7e2 (patch) | |
tree | 5dabc09e95ff54c18860ceb809f87a1f1ae51824 /clang/unittests/Format/FormatTestJS.cpp | |
parent | 2af5e6fbf921401f6dc5d71a44cbc1b609c1d30c (diff) | |
download | bcm5719-llvm-8c42d445e35bcb5a6ea39972757f298b9cf2f7e2.tar.gz bcm5719-llvm-8c42d445e35bcb5a6ea39972757f298b9cf2f7e2.zip |
clang-format: [JS] Support ES6 computed property names.
Before:
var x = {
[a]: 1,
b: 2
};
After:
var x = {
[a]: 1,
b: 2
};
llvm-svn: 238544
Diffstat (limited to 'clang/unittests/Format/FormatTestJS.cpp')
-rw-r--r-- | clang/unittests/Format/FormatTestJS.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp index a536926c73c..d95ff9ba834 100644 --- a/clang/unittests/Format/FormatTestJS.cpp +++ b/clang/unittests/Format/FormatTestJS.cpp @@ -151,6 +151,11 @@ TEST_F(FormatTestJS, ContainerLiterals) { // Arrow functions in object literals. verifyFormat("var x = {y: (a) => { return a; }};"); verifyFormat("var x = {y: (a) => a};"); + + // Computed keys. + verifyFormat("var x = {\n" + " [a]: 1,\n" + "};"); } TEST_F(FormatTestJS, MethodsInObjectLiterals) { |