aboutsummaryrefslogtreecommitdiff
path: root/test/compress/reduce_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-11-13 04:17:09 +0800
committerGitHub <noreply@github.com>2019-11-13 04:17:09 +0800
commitd6fd18d0b000e1e4fbe01259139043f42d8fdebf (patch)
tree7dca39ef5d97e53a4e5c1d062565df3d9313373f /test/compress/reduce_vars.js
parent0d17c5b0fa3a4305177f9561ba1f05835a9ffea3 (diff)
downloadtracifyjs-d6fd18d0b000e1e4fbe01259139043f42d8fdebf.tar.gz
tracifyjs-d6fd18d0b000e1e4fbe01259139043f42d8fdebf.zip
enhance `evaluate` & `inline` (#3580)
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r--test/compress/reduce_vars.js26
1 files changed, 10 insertions, 16 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index ce7c16da..a3421c00 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -1427,13 +1427,13 @@ defun_inline_3: {
defun_call: {
options = {
- inline: true,
+ evaluate: true,
reduce_funcs: true,
reduce_vars: true,
unused: true,
}
input: {
- function f() {
+ console.log(function f() {
return g() + h(1) - h(g(), 2, 3);
function g() {
return 4;
@@ -1441,21 +1441,17 @@ defun_call: {
function h(a) {
return a;
}
- }
+ }());
}
expect: {
- function f() {
- return 4 + h(1) - h(4);
- function h(a) {
- return a;
- }
- }
+ console.log(1);
}
+ expect_stdout: "1"
}
defun_redefine: {
options = {
- inline: true,
+ evaluate: true,
reduce_funcs: true,
reduce_vars: true,
unused: true,
@@ -1480,7 +1476,7 @@ defun_redefine: {
(function() {
return 3;
});
- return 3 + 2;
+ return 5;
}
console.log(f());
}
@@ -1517,7 +1513,7 @@ func_inline: {
func_modified: {
options = {
- inline: true,
+ evaluate: true,
reduce_funcs: true,
reduce_vars: true,
unused: true,
@@ -1550,7 +1546,7 @@ func_modified: {
(function() {
return 4;
});
- return 1 + 2 + 4;
+ return 7;
}
console.log(f());
}
@@ -5516,9 +5512,7 @@ issue_2860_1: {
}());
}
expect: {
- console.log(function(a) {
- return 1 ^ a;
- }());
+ console.log(1);
}
expect_stdout: "1"
}