summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Format
diff options
context:
space:
mode:
authorMartin Probst <martin@probst.io>2016-04-19 18:18:59 +0000
committerMartin Probst <martin@probst.io>2016-04-19 18:18:59 +0000
commit1e8261ea0430ecc0bed0ace31e0ec724a5a69270 (patch)
tree4d7c7087165130d2df79cab44fe91d82680d872c /clang/unittests/Format
parent461f2ff4457f5d8270c86c164ee368b47b141b06 (diff)
downloadbcm5719-llvm-1e8261ea0430ecc0bed0ace31e0ec724a5a69270.tar.gz
bcm5719-llvm-1e8261ea0430ecc0bed0ace31e0ec724a5a69270.zip
clang-format: [JS] support `interface` as a free standing identifier.
Summary: `interface` can be used as a fee standing identifier in JavaScript/TypeScript. This change uses the heuristic of whether it's followed by another identifier as an indication. Reviewers: djasper Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D19240 llvm-svn: 266789
Diffstat (limited to 'clang/unittests/Format')
-rw-r--r--clang/unittests/Format/FormatTestJS.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/unittests/Format/FormatTestJS.cpp b/clang/unittests/Format/FormatTestJS.cpp
index aa79fa30245..d23a55e2708 100644
--- a/clang/unittests/Format/FormatTestJS.cpp
+++ b/clang/unittests/Format/FormatTestJS.cpp
@@ -136,6 +136,9 @@ TEST_F(FormatTestJS, ReservedWords) {
"};");
verifyFormat("var struct = 2;");
verifyFormat("var union = 2;");
+ verifyFormat("var interface = 2;");
+ verifyFormat("interface = 2;");
+ verifyFormat("x = interface instanceof y;");
}
TEST_F(FormatTestJS, CppKeywords) {
OpenPOWER on IntegriCloud