aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-03-13 17:35:34 +0800
committerGitHub <noreply@github.com>2018-03-13 17:35:34 +0800
commit5429234138b1645d0c06de48c60e3c5469a81daf (patch)
tree55732a276f8ba97e3b4d8b1acfbbddb513c33823 /test
parentb9f72a4a81d69a7dd782a5ee70f7eee1cb4aa0e0 (diff)
downloadtracifyjs-5429234138b1645d0c06de48c60e3c5469a81daf.tar.gz
tracifyjs-5429234138b1645d0c06de48c60e3c5469a81daf.zip
preserve non-constant value assignments with modifications (#2997)
fixes #2995
Diffstat (limited to 'test')
-rw-r--r--test/compress/drop-unused.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index ee8e6c0c..301bff1c 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1785,3 +1785,32 @@ issue_805_2: {
"bar",
]
}
+
+issue_2995: {
+ options = {
+ pure_getters: "strict",
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ function f(a) {
+ var b;
+ a.b = b = function() {};
+ b.c = "PASS";
+ }
+ var o = {};
+ f(o);
+ console.log(o.b.c);
+ }
+ expect: {
+ function f(a) {
+ var b;
+ a.b = b = function() {};
+ b.c = "PASS";
+ }
+ var o = {};
+ f(o);
+ console.log(o.b.c);
+ }
+ expect_stdout: "PASS"
+}