diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/drop-unused.js | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js index a4a8595b..8c912a57 100644 --- a/test/compress/drop-unused.js +++ b/test/compress/drop-unused.js @@ -2690,3 +2690,68 @@ issue_3956: { "1", ] } + +issue_3962_1: { + options = { + evaluate: true, + keep_fargs: "strict", + reduce_vars: true, + toplevel: true, + unused: true, + } + input: { + var a = 0; + function f(b, c) { + do { + var d = console + e, e = 0..toString() === b; + } while (0); + if (c) console.log("PASS"); + } + var a = f(a--, 1); + a; + } + expect: { + var a = 0; + a = (function(c) { + do { + console; + 0..toString(); + } while (0); + if (c) console.log("PASS"); + })((a--, 1)); + void 0; + } + expect_stdout: "PASS" +} + +issue_3962_2: { + options = { + keep_fargs: "strict", + reduce_vars: true, + side_effects: true, + toplevel: true, + unused: true, + } + input: { + var a = 0; + function f(b, c) { + do { + var d = console + e, e = 0..toString() === b; + } while (0); + if (c) console.log("PASS"); + } + var a = f(a--, 1); + a; + } + expect: { + var a = 0; + a = (function(c) { + do { + console; + 0..toString(); + } while (0); + if (c) console.log("PASS"); + })((a--, 1)); + } + expect_stdout: "PASS" +} |