clang-format: [JS] for await, and fix a crash with for loops.
authorMartin Probst <martin@probst.io>
Thu, 18 May 2017 21:19:29 +0000 (21:19 +0000)
committerMartin Probst <martin@probst.io>
Thu, 18 May 2017 21:19:29 +0000 (21:19 +0000)
commita050f41c3c9b9bd4f3bbad48e029309eae0be05c
tree9c4d04d95f3b086cf617dbd4b4832b5daec28307
parent5e456b943a479e08e3f59e3520ff73f1cbf94e33
clang-format: [JS] for await, and fix a crash with for loops.

Summary:
The syntax is actually `for await (const x of y)` (d'oh).
This also fixes a crash for `for` tokens not followed by additional tokens.

Reviewers: djasper

Subscribers: cfe-commits, klimek

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

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