diff --git a/lib/compress.js b/lib/compress.js index 284b79adfc1..2c60a9b6bbd 100644 --- a/lib/compress.js +++ b/lib/compress.js @@ -5173,8 +5173,7 @@ merge(Compressor.prototype, { && !fn.uses_arguments && !fn.pinned()) { var pos = 0, last = 0; - var drop_fargs = exp === fn && compressor.drop_fargs(fn, self) - && (!fn.name || !fn.name.definition().recursive_refs); + var drop_fargs = exp === fn && !fn.name && compressor.drop_fargs(fn, self); var side_effects = []; for (var i = 0; i < self.args.length; i++) { var trim = i >= fn.argnames.length; diff --git a/test/compress/keep_fargs.js b/test/compress/keep_fargs.js index 29308ff3b66..a17a8f3f34a 100644 --- a/test/compress/keep_fargs.js +++ b/test/compress/keep_fargs.js @@ -1425,3 +1425,33 @@ recursive_iife_3: { } expect_stdout: "PASS" } + +issue_3619: { + options = { + keep_fargs: false, + unused: true, + } + input: { + var a = 1, b = "FAIL"; + (function f(c, d) { + function g() { + d && (b = "PASS", 0 <= --a && g()); + 0 <= --a && f(0, "function"); + } + g(); + })(); + console.log(b); + } + expect: { + var a = 1, b = "FAIL"; + (function f(c, d) { + function g() { + d && (b = "PASS", 0 <= --a && g()); + 0 <= --a && f(0, "function"); + } + g(); + })(); + console.log(b); + } + expect_stdout: "PASS" +}