clang-format: [JS] do not merge side-effect imports.
authorMartin Probst <martin@probst.io>
Thu, 22 Apr 2021 05:54:11 +0000 (07:54 +0200)
committerMartin Probst <martin@probst.io>
Thu, 22 Apr 2021 08:36:47 +0000 (10:36 +0200)
commitfbc6f42dbee5d1d4ced30f520418c2b62942845a
treef423bb5b8de06a9b4858eb1a2137fed1304eaf68
parent79cb3ba08f8022ad1bb664bb0d0cd3cfe5111001
clang-format: [JS] do not merge side-effect imports.

The if condition was testing the current element, but
forgot to check the previous element (doh), so it
would fail depending on sort order of the imports.

Differential Revision: https://reviews.llvm.org/D101020
clang/lib/Format/SortJavaScriptImports.cpp
clang/unittests/Format/SortImportsTestJS.cpp