forked from OSchip/llvm-project
clang-format: [JS] Fix spacing in destructuring assignments.
Before: const[a, b, c] = [1, 2, 3]; After: const [a, b, c] = [1, 2, 3]; llvm-svn: 270029
This commit is contained in:
parent
451544ab57
commit
5dbcd3bd07
|
@ -2083,7 +2083,7 @@ bool TokenAnnotator::spaceRequiredBefore(const AnnotatedLine &Line,
|
|||
Left.isOneOf(Keywords.kw_function, Keywords.kw_yield))
|
||||
return false;
|
||||
if (Left.isOneOf(Keywords.kw_let, Keywords.kw_var, Keywords.kw_in,
|
||||
Keywords.kw_of) &&
|
||||
Keywords.kw_of, tok::kw_const) &&
|
||||
(!Left.Previous || !Left.Previous->is(tok::period)))
|
||||
return true;
|
||||
if (Left.is(tok::kw_default) && Left.Previous &&
|
||||
|
|
|
@ -148,6 +148,7 @@ TEST_F(FormatTestJS, CppKeywords) {
|
|||
|
||||
TEST_F(FormatTestJS, ES6DestructuringAssignment) {
|
||||
verifyFormat("var [a, b, c] = [1, 2, 3];");
|
||||
verifyFormat("const [a, b, c] = [1, 2, 3];");
|
||||
verifyFormat("let [a, b, c] = [1, 2, 3];");
|
||||
verifyFormat("var {a, b} = {a: 1, b: 2};");
|
||||
verifyFormat("let {a, b} = {a: 1, b: 2};");
|
||||
|
|
Loading…
Reference in New Issue