diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-04-23 01:31:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-23 08:31:35 +0800 |
commit | 99cf3a38c53d4a8e4ac937962df4a0fdc600c070 (patch) | |
tree | 1407dcddfcc13871301c9093159b6f92f5651b4f /test/compress | |
parent | 3ae24329eb29c9b1c924c16778348e7ae7efc510 (diff) | |
download | tracifyjs-99cf3a38c53d4a8e4ac937962df4a0fdc600c070.tar.gz tracifyjs-99cf3a38c53d4a8e4ac937962df4a0fdc600c070.zip |
improve `unused` efficiency (#3813)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/directives.js | 6 | ||||
-rw-r--r-- | test/compress/issue-1034.js | 8 |
2 files changed, 6 insertions, 8 deletions
diff --git a/test/compress/directives.js b/test/compress/directives.js index 69ecfdc4..6c85fded 100644 --- a/test/compress/directives.js +++ b/test/compress/directives.js @@ -46,7 +46,7 @@ simple_statement_is_not_a_directive: { drop_lone_use_strict: { options = { directives: true, - side_effects: true, + unused: true, } input: { function f1() { @@ -66,10 +66,8 @@ drop_lone_use_strict: { function f1() { } function f2() { - "use strict"; - function f3() { - } } + (function() {})(); } } diff --git a/test/compress/issue-1034.js b/test/compress/issue-1034.js index 316d6a75..137aed8c 100644 --- a/test/compress/issue-1034.js +++ b/test/compress/issue-1034.js @@ -90,13 +90,13 @@ non_hoisted_function_after_return_2a: { "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:7,16]", "WARN: Dropping unused variable a [test/compress/issue-1034.js:4,20]", "WARN: Dropping unused function nope [test/compress/issue-1034.js:11,21]", - "INFO: pass 0: last_count: Infinity, count: 37", + "INFO: pass 0: last_count: Infinity, count: 36", "WARN: Dropping unreachable code [test/compress/issue-1034.js:9,12]", "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:9,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:12,12]", "INFO: Dropping unused variable b [test/compress/issue-1034.js:7,20]", "INFO: Dropping unused variable c [test/compress/issue-1034.js:9,16]", - "INFO: pass 1: last_count: 37, count: 18", + "INFO: pass 1: last_count: 36, count: 18", ] } @@ -248,13 +248,13 @@ non_hoisted_function_after_return_2a_strict: { "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:8,16]", "WARN: Dropping unused variable a [test/compress/issue-1034.js:5,20]", "WARN: Dropping unused function nope [test/compress/issue-1034.js:12,21]", - "INFO: pass 0: last_count: Infinity, count: 48", + "INFO: pass 0: last_count: Infinity, count: 47", "WARN: Dropping unreachable code [test/compress/issue-1034.js:10,12]", "WARN: Declarations in unreachable code! [test/compress/issue-1034.js:10,12]", "WARN: Dropping unreachable code [test/compress/issue-1034.js:13,12]", "INFO: Dropping unused variable b [test/compress/issue-1034.js:8,20]", "INFO: Dropping unused variable c [test/compress/issue-1034.js:10,16]", - "INFO: pass 1: last_count: 48, count: 29", + "INFO: pass 1: last_count: 47, count: 29", ] } |