From b8b133d91a7a65f3375d391a036623901d1e357f Mon Sep 17 00:00:00 2001 From: alexlamsl Date: Sat, 18 Feb 2017 19:19:12 +0800 Subject: improve keep_fargs & keep_fnames - utilise in_use_ids instead of unreferenced() - drop_unused now up-to-date for subsequent passes closes #1476 --- test/compress/drop-unused.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'test') 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() {}; + } + } +} -- cgit v1.2.3