aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2018-01-02 01:24:23 +0800
committerGitHub <noreply@github.com>2018-01-02 01:24:23 +0800
commit2f3bddbacaaafb73ed046090a74ce6558c54a218 (patch)
tree68da74c2f75533dfaae9caa9f6c0d21fbdf34269 /test
parent673b0716379e261008b6cbf187e6b212104fb69e (diff)
downloadtracifyjs-2f3bddbacaaafb73ed046090a74ce6558c54a218.tar.gz
tracifyjs-2f3bddbacaaafb73ed046090a74ce6558c54a218.zip
scan within IIFEs of assigned values (#2702)
fixes #2701
Diffstat (limited to 'test')
-rw-r--r--test/compress/dead-code.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 68ee4b12..32bb88e6 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -881,3 +881,31 @@ issue_2692: {
}
expect_stdout: "function"
}
+
+issue_2701: {
+ options = {
+ dead_code: true,
+ inline: false,
+ }
+ input: {
+ function f(a) {
+ return a = function() {
+ return function() {
+ return a;
+ };
+ }();
+ }
+ console.log(typeof f()());
+ }
+ expect: {
+ function f(a) {
+ return a = function() {
+ return function() {
+ return a;
+ };
+ }();
+ }
+ console.log(typeof f()());
+ }
+ expect_stdout: "function"
+}