Skip to content

Commit 6bcd8d4

Browse files
committed
clang-format: [JS] test declared fields.
Summary: TypeScript now supports declaring fields: class Foo { declare field: string; } clang-format happens to already format this fine, so this change just adds a regression test. Reviewers: krasimir Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D69972
1 parent a7638d3 commit 6bcd8d4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

clang/unittests/Format/FormatTestJS.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2369,5 +2369,12 @@ TEST_F(FormatTestJS, SupportPrivateFieldsAndMethods) {
23692369
" static #staticPrivateMethod() {}\n");
23702370
}
23712371

2372+
TEST_F(FormatTestJS, DeclaredFields) {
2373+
verifyFormat("class Example {\n"
2374+
" declare pub: string;\n"
2375+
" declare private priv: string;\n"
2376+
"}\n");
2377+
}
2378+
23722379
} // namespace format
23732380
} // end namespace clang

0 commit comments

Comments
 (0)