clang-format: [JS] ignore comments when wrapping returns.
authorMartin Probst <martin@probst.io>
Tue, 6 Sep 2016 18:39:30 +0000 (18:39 +0000)
committerMartin Probst <martin@probst.io>
Tue, 6 Sep 2016 18:39:30 +0000 (18:39 +0000)
commit56ff7aaacb4413b537d7d381a2502b371150466b
tree90834ad636b9c966fecaecbb83c237e501b7aafb
parent5baa1c76410e2d250a897f92ddc92dbdcd69040c
clang-format: [JS] ignore comments when wrapping returns.

Summary:
When code contains a comment between `return` and the value:

    return /* lengthy comment here */ (
        lengthyValueComesHere);

Do not wrap before the comment, as that'd break the code through JS' automatic
semicolon insertion.

Reviewers: djasper

Subscribers: klimek, cfe-commits

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

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