aboutsummaryrefslogtreecommitdiff
path: root/test/compress/dead-code.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-10-30 06:34:54 +0800
committerGitHub <noreply@github.com>2019-10-30 06:34:54 +0800
commitf1eb03f2c0f860a963b2f61c5f8565d8703a18cb (patch)
treee03cc18f5043bef0f2632a681ffb1865337955f9 /test/compress/dead-code.js
parent0f4cfa877a9f14a75b219c04947ce5984772d8ba (diff)
downloadtracifyjs-f1eb03f2c0f860a963b2f61c5f8565d8703a18cb.tar.gz
tracifyjs-f1eb03f2c0f860a963b2f61c5f8565d8703a18cb.zip
enhance `dead_code` (#3551)
Diffstat (limited to 'test/compress/dead-code.js')
-rw-r--r--test/compress/dead-code.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/dead-code.js b/test/compress/dead-code.js
index 190a3243..501d55ec 100644
--- a/test/compress/dead-code.js
+++ b/test/compress/dead-code.js
@@ -1013,3 +1013,32 @@ issue_3406: {
}
expect_stdout: "true"
}
+
+function_assign: {
+ options = {
+ dead_code: true,
+ }
+ input: {
+ console.log(function() {
+ var a = "PASS";
+ function h(c) {
+ return c;
+ }
+ h.p = function(b) {
+ return b;
+ }.p = a;
+ return h;
+ }().p);
+ }
+ expect: {
+ console.log(function() {
+ var a = "PASS";
+ function h(c) {
+ return c;
+ }
+ h.p = a;
+ return h;
+ }().p);
+ }
+ expect_stdout: "PASS"
+}