@@ -23,6 +23,7 @@ ruleTester.run("no-unmodified-loop-condition", rule, {
23
23
"var foo = 0; while (foo++) { }" ,
24
24
"var foo = 0; while (foo = next()) { }" ,
25
25
"var foo = 0; while (ok(foo)) { }" ,
26
+ "var foo = 0, bar = 0; while (++foo < bar) { }" ,
26
27
"var foo = 0, obj = {}; while (foo === obj.bar) { }" ,
27
28
"var foo = 0, f = {}, bar = {}; while (foo === f(bar)) { }" ,
28
29
"var foo = 0, f = {}; while (foo === f()) { }" ,
@@ -49,6 +50,7 @@ ruleTester.run("no-unmodified-loop-condition", rule, {
49
50
{ code : "var foo = 0, bar = 9; while (foo < bar) { } foo = 1;" , errors : [ "'foo' is not modified in this loop." , "'bar' is not modified in this loop." ] } ,
50
51
{ code : "var foo = 0, bar = 0; while (foo && bar) { ++bar; } foo = 1;" , errors : [ "'foo' is not modified in this loop." ] } ,
51
52
{ code : "var foo = 0, bar = 0; while (foo && bar) { ++foo; } foo = 1;" , errors : [ "'bar' is not modified in this loop." ] } ,
53
+ { code : "var a, b, c; while (a < c && b < c) { ++a; } foo = 1;" , errors : [ "'b' is not modified in this loop." , "'c' is not modified in this loop." ] } ,
52
54
{ code : "var foo = 0; while (foo ? 1 : 0) { } foo = 1;" , errors : [ "'foo' is not modified in this loop." ] } ,
53
55
{ code : "var foo = 0; while (foo) { update(); } function update(foo) { ++foo; }" , errors : [ "'foo' is not modified in this loop." ] } ,
54
56
{ code : "var foo; do { } while (foo);" , errors : [ "'foo' is not modified in this loop." ] } ,
0 commit comments