From 9b58b54e2d7ce4ab2c015611add52c7475de9eab Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 4 Jan 2018 12:58:40 +0800 Subject: extend `inline` (#2714) - compress `function` with variables within loops - restrict to `AST_Var` for better compatibility with ES6+ --- test/compress/functions.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/compress/functions.js') diff --git a/test/compress/functions.js b/test/compress/functions.js index b6b68982..ff3baeb2 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -1299,6 +1299,7 @@ issue_2630_2: { passes: 2, reduce_vars: true, sequences: true, + side_effects: true, unused: true, } input: { @@ -1905,6 +1906,7 @@ inline_true: { use_before_init_in_loop: { options = { inline: true, + side_effects: true, toplevel: true, } input: { @@ -1918,9 +1920,9 @@ use_before_init_in_loop: { } expect: { var a = "PASS"; - for (var b = 2; --b >= 0;) (function() { - var c = (c && (a = "FAIL"), 1); - })(); + for (var b = 2; --b >= 0;) + c = void 0, c = (c && (a = "FAIL"), 1); + var c; console.log(a); } expect_stdout: "PASS" -- cgit v1.2.3