aboutsummaryrefslogtreecommitdiff
path: root/test/compress/functions.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-03-21 02:58:33 +0800
committerGitHub <noreply@github.com>2019-03-21 02:58:33 +0800
commit54b0b49b6810ab77a733da6a88133ad47940c9d9 (patch)
tree7378c6cd38d8258e7ac6170bd8e8b4e94ab665c7 /test/compress/functions.js
parent65648d84a5f1df20e6a839cde9fc9dcabc7e13ea (diff)
downloadtracifyjs-54b0b49b6810ab77a733da6a88133ad47940c9d9.tar.gz
tracifyjs-54b0b49b6810ab77a733da6a88133ad47940c9d9.zip
enhance `inline` (#3352)
Diffstat (limited to 'test/compress/functions.js')
-rw-r--r--test/compress/functions.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js
index a52796c2..cb7a1b86 100644
--- a/test/compress/functions.js
+++ b/test/compress/functions.js
@@ -2675,3 +2675,31 @@ cross_references_3: {
"9 27",
]
}
+
+loop_inline: {
+ options = {
+ inline: true,
+ reduce_vars: true,
+ unused: true,
+ }
+ input: {
+ console.log(function(o) {
+ function g(p) {
+ return o[p];
+ }
+ function h(q) {
+ while (g(q));
+ }
+ return h;
+ }([ 1, "foo", 0 ])(2));
+ }
+ expect: {
+ console.log(function(o) {
+ return function(q) {
+ while (p = q, o[p]);
+ var p;
+ };
+ }([ 1, "foo", 0 ])(2));
+ }
+ expect_stdout: "undefined"
+}