aboutsummaryrefslogtreecommitdiff
path: root/test/compress/drop-unused.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-16 03:21:38 +0800
committerGitHub <noreply@github.com>2017-06-16 03:21:38 +0800
commit33405bb24b9a5933badf146a9576953b8b456aad (patch)
tree14e2b0e79a3f27474b67945ca971e7978b1431a5 /test/compress/drop-unused.js
parent57dc4fb32f04b167581f247d5a3d59986c0c2724 (diff)
downloadtracifyjs-33405bb24b9a5933badf146a9576953b8b456aad.tar.gz
tracifyjs-33405bb24b9a5933badf146a9576953b8b456aad.zip
enforce `inline` scope restriction (#2106)
fixes #2105
Diffstat (limited to 'test/compress/drop-unused.js')
-rw-r--r--test/compress/drop-unused.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/compress/drop-unused.js b/test/compress/drop-unused.js
index af792bfa..08fc7b18 100644
--- a/test/compress/drop-unused.js
+++ b/test/compress/drop-unused.js
@@ -1108,3 +1108,47 @@ var_catch_toplevel: {
}();
}
}
+
+issue_2105: {
+ options = {
+ collapse_vars: true,
+ inline: true,
+ reduce_vars: true,
+ side_effects: true,
+ unused: true,
+ }
+ input: {
+ !function(factory) {
+ factory();
+ }( function() {
+ return function(fn) {
+ fn()().prop();
+ }( function() {
+ function bar() {
+ var quux = function() {
+ console.log("PASS");
+ }, foo = function() {
+ console.log;
+ quux();
+ };
+ return { prop: foo };
+ }
+ return bar;
+ } );
+ });
+ }
+ expect: {
+ !void function() {
+ var quux = function() {
+ console.log("PASS");
+ };
+ return {
+ prop: function() {
+ console.log;
+ quux();
+ }
+ };
+ }().prop();
+ }
+ expect_stdout: "PASS"
+}