diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-03-23 06:49:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 06:49:49 +0800 |
commit | c0f3feae9f251abbea5ae1198e1a6784dd3261f7 (patch) | |
tree | 2ed4fbc646f4b8798e515a6a50003216a080a7a6 /test | |
parent | a00040dd93083548aa065c5ae8942e3c2600cbbe (diff) | |
download | tracifyjs-c0f3feae9f251abbea5ae1198e1a6784dd3261f7.tar.gz tracifyjs-c0f3feae9f251abbea5ae1198e1a6784dd3261f7.zip |
introduce compressor.info() (#1633)
report the following only when `options.warnings = "verbose"`
- unused elements due to inlining
- collpased variables
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/issue-1034.js | 7 | ||||
-rwxr-xr-x | test/run-tests.js | 2 |
2 files changed, 3 insertions, 6 deletions
diff --git a/test/compress/issue-1034.js b/test/compress/issue-1034.js index b91eaced..57c584ab 100644 --- a/test/compress/issue-1034.js +++ b/test/compress/issue-1034.js @@ -39,7 +39,7 @@ non_hoisted_function_after_return_2a: { hoist_funs: false, dead_code: true, conditionals: true, comparisons: true, evaluate: true, booleans: true, loops: true, unused: true, keep_fargs: true, if_return: true, join_vars: true, cascade: true, side_effects: true, - collapse_vars: false, passes: 2 + collapse_vars: false, passes: 2, warnings: "verbose" } input: { function foo(x) { @@ -75,7 +75,7 @@ non_hoisted_function_after_return_2a: { "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:53,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:56,12]", "WARN: Dropping unused variable b [test/compress/issue-1034.js:51,20]", - "WARN: Dropping unused variable c [test/compress/issue-1034.js:53,16]" + "WARN: Dropping unused variable c [test/compress/issue-1034.js:53,16]", ] } @@ -114,8 +114,5 @@ non_hoisted_function_after_return_2b: { "WARN: Dropping unreachable code [test/compress/issue-1034.js:97,12]", "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:97,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:101,12]", - "WARN: Dropping unused variable b [test/compress/issue-1034.js:95,20]", - "WARN: Dropping unused variable c [test/compress/issue-1034.js:97,16]" ] } - diff --git a/test/run-tests.js b/test/run-tests.js index a3184d72..09e70021 100755 --- a/test/run-tests.js +++ b/test/run-tests.js @@ -114,7 +114,7 @@ function run_compress_tests() { U.AST_Node.warn_function = function(text) { warnings_emitted.push("WARN: " + text); }; - options.warnings = true; + if (!options.warnings) options.warnings = true; } var cmp = new U.Compressor(options, true); var output_options = test.beautify || {}; |