aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-08-23 06:03:39 +0800
committerGitHub <noreply@github.com>2018-08-23 06:03:39 +0800
commit694ca5d04590fc22001f7a1c9cc185198f32248f (patch)
tree278e456909f7c5bcb8783e921129838b6c866819 /test/compress/drop-unused.js
parent57fb58b263677d8667eadc94634c2018934a0f52 (diff)
downloadtracifyjs-694ca5d04590fc22001f7a1c9cc185198f32248f.tar.gz
tracifyjs-694ca5d04590fc22001f7a1c9cc185198f32248f.zip
fix corner case in `unused` (#3234)
fixes #3233
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r--test/compress/drop-unused.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index 9dc45e57..b75c3ac5 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1982,3 +1982,26 @@ issue_3192: {
"foo bar",
]
}
+
+issue_3233: {
+ options = {
+ pure_getters: "strict",
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ var a = function b() {
+ b.c = "PASS";
+ };
+ a();
+ console.log(a.c);
+ }
+ expect: {
+ var a = function b() {
+ b.c = "PASS";
+ };
+ a();
+ console.log(a.c);
+ }
+ expect_stdout: "PASS"
+}