diff options
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r-- | test/compress/dead-code.js | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js index 89829b65..3a5a4527 100644 --- a/test/compress/dead-code.js +++ b/test/compress/dead-code.js @@ -59,6 +59,11 @@ dead_code_2_should_warn: { f(); } expect_stdout: true + expect_warnings: [ + "WARN: Dropping unreachable code [test/compress/dead-code.js:8,12]", + "WARN: Declarations in unreachable code! [test/compress/dead-code.js:10,16]", + "WARN: Dropping unreachable code [test/compress/dead-code.js:10,16]", + ] node_version: "<=4" } @@ -89,11 +94,23 @@ dead_code_constant_boolean_should_warn_more: { function bar() {} // nothing for the while // as for the for, it should keep: - var moo; var x = 10, y; + var moo; bar(); } expect_stdout: true + expect_warnings: [ + "WARN: + in boolean context always true [test/compress/dead-code.js:1,33]", + "WARN: Boolean || always true [test/compress/dead-code.js:1,16]", + "WARN: Dropping unreachable code [test/compress/dead-code.js:1,45]", + "WARN: Declarations in unreachable code! [test/compress/dead-code.js:3,12]", + "WARN: Boolean expression always true [test/compress/dead-code.js:6,47]", + "WARN: Boolean && always false [test/compress/dead-code.js:6,28]", + "WARN: Dropping unreachable code [test/compress/dead-code.js:6,63]", + "WARN: Declarations in unreachable code! [test/compress/dead-code.js:9,12]", + "WARN: Dropping side-effect-free statement [test/compress/dead-code.js:1,15]", + "WARN: Dropping side-effect-free statement [test/compress/dead-code.js:6,28]", + ] node_version: "<=4" } |