| 40 columns | |
| ### Test for loop formatting that isn't affected by the for loop parts. |
| >>> No clauses. |
| for ( ; ; ) { body; } |
| <<< |
| for (;;) { |
| body; |
| } |
| >>> Single line for body without braces. |
| for (i = 0; i < 10; i) something(i); |
| <<< |
| for (i = 0; i < 10; i) something(i); |
| >>> Split for body without braces. |
| for (i = 0; i < 10; i) somethingLonger(i); |
| <<< |
| for (i = 0; i < 10; i) |
| somethingLonger(i); |
| >>> Expression split in pattern. |
| for (var (longIdentifier && anotherLongOne) = obj; cond; inc) {;} |
| <<< |
| for ( |
| var (longIdentifier && |
| anotherLongOne) = |
| obj; |
| cond; |
| inc |
| ) { |
| ; |
| } |
| >>> Block split in pattern. |
| for (var [longIdentifier, anotherReallyLongOne] = obj; cond; inc) {;} |
| <<< |
| for ( |
| var [ |
| longIdentifier, |
| anotherReallyLongOne, |
| ] = obj; |
| cond; |
| inc |
| ) { |
| ; |
| } |
| >>> With pattern, split in initializer. |
| for (var (first, second, third) = longValueExpression + anotherOperand + |
| aThirdOperand; cond; inc) {;} |
| <<< |
| for ( |
| var (first, second, third) = |
| longValueExpression + |
| anotherOperand + |
| aThirdOperand; |
| cond; |
| inc |
| ) { |
| ; |
| } |
| >>> Split in pattern and initializer. |
| for (var (longIdentifier && anotherAlsoLongOne) = longValueExpression + |
| anotherOperand + aThirdOperand; cond; inc) {;} |
| <<< |
| for ( |
| var (longIdentifier && |
| anotherAlsoLongOne) = |
| longValueExpression + |
| anotherOperand + |
| aThirdOperand; |
| cond; |
| inc |
| ) { |
| ; |
| } |