Clean up unit test breakage
In 992b6b9fcc unit test broke (which I missed). This was due to undeclared variables not being side-effects free.
However, since they're really not side-effect free, just declare them in the test cases.
This commit is contained in:
@@ -53,6 +53,7 @@ ifs_3_should_warn: {
|
|||||||
booleans : true
|
booleans : true
|
||||||
};
|
};
|
||||||
input: {
|
input: {
|
||||||
|
var x, y;
|
||||||
if (x && !(x + "1") && y) { // 1
|
if (x && !(x + "1") && y) { // 1
|
||||||
var qq;
|
var qq;
|
||||||
foo();
|
foo();
|
||||||
@@ -68,6 +69,7 @@ ifs_3_should_warn: {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
expect: {
|
expect: {
|
||||||
|
var x, y;
|
||||||
var qq; bar(); // 1
|
var qq; bar(); // 1
|
||||||
var jj; foo(); // 2
|
var jj; foo(); // 2
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ dead_code_constant_boolean_should_warn_more: {
|
|||||||
var foo;
|
var foo;
|
||||||
function bar() {}
|
function bar() {}
|
||||||
}
|
}
|
||||||
for (var x = 10; x && (y || x) && (!typeof x); ++x) {
|
for (var x = 10, y; x && (y || x) && (!typeof x); ++x) {
|
||||||
asdf();
|
asdf();
|
||||||
foo();
|
foo();
|
||||||
var moo;
|
var moo;
|
||||||
@@ -83,7 +83,7 @@ dead_code_constant_boolean_should_warn_more: {
|
|||||||
function bar() {}
|
function bar() {}
|
||||||
// nothing for the while
|
// nothing for the while
|
||||||
// as for the for, it should keep:
|
// as for the for, it should keep:
|
||||||
var x = 10;
|
var x = 10, y;
|
||||||
var moo;
|
var moo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user