diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-10-11 18:18:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 01:18:57 +0800 |
commit | 55451e7b78c1765c6c3011d880c7980c10b7330f (patch) | |
tree | 8e63243cf2c73dd25867e2cb1ba3c8d7cf0ed1e9 /test/compress/dead-code.js | |
parent | ffcce28ce15afe9f0b8d8a4a83b901508eb866de (diff) | |
download | tracifyjs-55451e7b78c1765c6c3011d880c7980c10b7330f.tar.gz tracifyjs-55451e7b78c1765c6c3011d880c7980c10b7330f.zip |
support `const` (#4190)
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" } |