clang-format: [JS] handle destructuring `of`.
authorMartin Probst <martin@probst.io>
Fri, 24 Nov 2017 10:48:25 +0000 (10:48 +0000)
committerMartin Probst <martin@probst.io>
Fri, 24 Nov 2017 10:48:25 +0000 (10:48 +0000)
commit70cec59e237fcd2d26da3e5994ed5572a87130d1
tree8fd71c2fd9b6d0179da166e217412e83539fe5bf
parent4b9ee769ca09bac2fd5710d5145be35569b4fc61
clang-format: [JS] handle destructuring `of`.

Summary:
Previously, clang-format would drop a space character between `of` and
then following (non-identifier) token if the preceding token was part of
a destructuring assignment (`}` or `]`).

Before:
    for (const [a, b] of[]) {}

After:
    for (const [a, b] of []) {}

Reviewers: djasper

Subscribers: klimek

Differential Revision: https://reviews.llvm.org/D40411

llvm-svn: 318942
clang/lib/Format/TokenAnnotator.cpp
clang/unittests/Format/FormatTestJS.cpp