From b95e3338d9704927046a030fe814302f55737e0d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Thu, 28 Dec 2017 17:01:01 +0800 Subject: fix `pure_getters` on `AST_Binary` (#2681) fixes #2678 --- test/compress/pure_getters.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'test') diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js index 4174bc1b..7185e0c6 100644 --- a/test/compress/pure_getters.js +++ b/test/compress/pure_getters.js @@ -611,3 +611,35 @@ issue_2313_6: { x(); } } + +issue_2678: { + options = { + pure_getters: "strict", + side_effects: true, + } + input: { + var a = 1, c = "FAIL"; + (function f() { + (a-- && f()).p; + return { + get p() { + c = "PASS"; + } + }; + })(); + console.log(c); + } + expect: { + var a = 1, c = "FAIL"; + (function f() { + (a-- && f()).p; + return { + get p() { + c = "PASS"; + } + }; + })(); + console.log(c); + } + expect_stdout: "PASS" +} -- cgit v1.2.3