diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/collapse_vars.js | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 81f24175..abdd9c2a 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -3852,10 +3852,9 @@ issue_2436_9: { expect: { var o = console; console.log({ - x: (c = o).a, - y: c.b, + x: o.a, + y: o.b, }); - var c; } expect_stdout: true } @@ -6567,3 +6566,29 @@ issue_3596: { } expect_stdout: "42" } + +local_value_replacement: { + options = { + collapse_vars: true, + unused: true, + } + input: { + function f(a, b) { + (a = b) && g(a); + } + function g(c) { + console.log(c); + } + f("FAIL", "PASS"); + } + expect: { + function f(a, b) { + (a = b) && g(a); + } + function g(c) { + console.log(c); + } + f("FAIL", "PASS"); + } + expect_stdout: "PASS" +} |