https://bugs.llvm.org/show_bug.cgi?id=49960
clang-format can mutate legal javascript code due to missing semicolons, but clang format pulls the next line into the first causing incorrect grammar.
function t() { if (true) return const v = 42 }
clang-format result:
function t() { if (true) return const v = 42 }
This was already somewhat addressed by the work of @mprobst in https://reviews.llvm.org/rG1dcbbcfc5cf06d2eacc68fbe9b6fc1fb12168d6f back in 2016, but this revision aims to identify other possible places so clang-format wouldn't be quite so destructive as people develop.
nit: just return AllTokens[TokenPosition]?