aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2017-02-18 19:19:12 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:58 +0800
commitb8b133d91a7a65f3375d391a036623901d1e357f (patch)
tree83259d7f56894355d98f02f2c9ac3d6ad971751f /test
parentc525a2b1907fdef36acffdeea4cf02ae476d8399 (diff)
downloadtracifyjs-b8b133d91a7a65f3375d391a036623901d1e357f.tar.gz
tracifyjs-b8b133d91a7a65f3375d391a036623901d1e357f.zip
improve keep_fargs & keep_fnames
- utilise in_use_ids instead of unreferenced() - drop_unused now up-to-date for subsequent passes closes #1476
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-unused.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 5620cf40..5a09c6cd 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -556,3 +556,37 @@ drop_toplevel_keep_assign: {
console.log(b = 3);
}
}
+
+drop_fargs: {
+ options = {
+ keep_fargs: false,
+ unused: true,
+ }
+ input: {
+ function f(a) {
+ var b = a;
+ }
+ }
+ expect: {
+ function f() {}
+ }
+}
+
+drop_fnames: {
+ options = {
+ keep_fnames: false,
+ unused: true,
+ }
+ input: {
+ function f() {
+ return function g() {
+ var a = g;
+ };
+ }
+ }
+ expect: {
+ function f() {
+ return function() {};
+ }
+ }
+}