From c0f3feae9f251abbea5ae1198e1a6784dd3261f7 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 23 Mar 2017 06:49:49 +0800 Subject: introduce compressor.info() (#1633) report the following only when `options.warnings = "verbose"` - unused elements due to inlining - collpased variables --- test/compress/issue-1034.js | 7 ++----- test/run-tests.js | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) (limited to 'test') 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 || {}; -- cgit v1.2.3