From 24aa07855bc608f29cca2a58a40af1988256b116 Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Sun, 22 Oct 2017 20:10:13 +0800 Subject: safer `properties` transform (#2391) `{ a: x, b: y }.a` => `[ x, y ][0]` - `x` cannot be function containing `this` `[ x, y, z ][1]` => `(x, z, y)` - only if `z` is side-effect-free --- test/compress/collapse_vars.js | 67 ------------------------------------------ 1 file changed, 67 deletions(-) (limited to 'test/compress/collapse_vars.js') diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index 52b2ddf8..1f702ad7 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -2534,73 +2534,6 @@ issue_2319_3: { expect_stdout: "true" } -prop_side_effects_1: { - options = { - collapse_vars: true, - evaluate: true, - pure_getters: "strict", - reduce_vars: true, - toplevel: true, - unsafe: true, - unused: true, - } - input: { - var C = 1; - console.log(C); - var obj = { - bar: function() { - return C + C; - } - }; - console.log(obj.bar()); - } - expect: { - console.log(1); - console.log({ - bar: function() { - return 2; - } - }.bar()); - } - expect_stdout: [ - "1", - "2", - ] -} - -prop_side_effects_2: { - options = { - collapse_vars: true, - evaluate: true, - inline: true, - passes: 2, - pure_getters: "strict", - reduce_vars: true, - side_effects: true, - toplevel: true, - unsafe: true, - unused: true, - } - input: { - var C = 1; - console.log(C); - var obj = { - bar: function() { - return C + C; - } - }; - console.log(obj.bar()); - } - expect: { - console.log(1); - console.log(2); - } - expect_stdout: [ - "1", - "2", - ] -} - issue_2365: { options = { collapse_vars: true, -- cgit v1.2.3