aboutsummaryrefslogtreecommitdiff
path: root/test/compress/pure_getters.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-28 17:01:01 +0800
committerGitHub <noreply@github.com>2017-12-28 17:01:01 +0800
commitb95e3338d9704927046a030fe814302f55737e0d (patch)
tree946c2b3826709e79b71263f3219119b4196f5c71 /test/compress/pure_getters.js
parente40a0ee9c6c4dfbd9506dfcbb76ccd1565bc4ad9 (diff)
downloadtracifyjs-b95e3338d9704927046a030fe814302f55737e0d.tar.gz
tracifyjs-b95e3338d9704927046a030fe814302f55737e0d.zip
fix `pure_getters` on `AST_Binary` (#2681)
fixes #2678
Diffstat (limited to 'test/compress/pure_getters.js')
-rw-r--r--test/compress/pure_getters.js32
1 files changed, 32 insertions, 0 deletions
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"
+}