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:
Richard van Velzen
2015-02-11 21:27:21 +01:00
parent 992b6b9fcc
commit 61e850ceb5
2 changed files with 91 additions and 89 deletions

View File

@@ -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
} }

View File

@@ -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;
} }
} }