aboutsummaryrefslogtreecommitdiff
path: root/test/compress/reduce_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-06-06 05:49:53 +0800
committerGitHub <noreply@github.com>2017-06-06 05:49:53 +0800
commit3493a182b2c94e4011b2b12d61376273b985d29a (patch)
tree449238f5af448b90551f66d92ce87a4a2a317103 /test/compress/reduce_vars.js
parent27c5284d3dc0ab131168a73035be7d87ebda30e9 (diff)
downloadtracifyjs-3493a182b2c94e4011b2b12d61376273b985d29a.tar.gz
tracifyjs-3493a182b2c94e4011b2b12d61376273b985d29a.zip
implement function inlining (#2053)
- empty body - single `AST_Return` - single `AST_SimpleStatement` - avoid `/*#__PURE__*/` Miscellaneous - enhance single-use function substitution fixes #281
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r--test/compress/reduce_vars.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 078de82d..cef29832 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -2,6 +2,7 @@ reduce_vars: {
options = {
conditionals : true,
evaluate : true,
+ inline : true,
global_defs : {
C : 0
},
@@ -1032,6 +1033,7 @@ defun_inline_2: {
defun_inline_3: {
options = {
evaluate: true,
+ inline: true,
passes: 2,
reduce_vars: true,
side_effects: true,
@@ -1054,6 +1056,7 @@ defun_inline_3: {
defun_call: {
options = {
+ inline: true,
reduce_vars: true,
unused: true,
}
@@ -1080,6 +1083,7 @@ defun_call: {
defun_redefine: {
options = {
+ inline: true,
reduce_vars: true,
unused: true,
}
@@ -1112,6 +1116,7 @@ defun_redefine: {
func_inline: {
options = {
+ inline: true,
reduce_vars: true,
unused: true,
}
@@ -1138,6 +1143,7 @@ func_inline: {
func_modified: {
options = {
+ inline: true,
reduce_vars: true,
unused: true,
}
@@ -1340,10 +1346,9 @@ iife_func_side_effects: {
console.log("z");
}
(function(a, b, c) {
- function y() {
+ return function() {
console.log("FAIL");
- }
- return y + b();
+ } + b();
})(x(), function() {
return y();
}, z());
@@ -1716,6 +1721,7 @@ redefine_arguments_1: {
redefine_arguments_2: {
options = {
evaluate: true,
+ inline: true,
keep_fargs: false,
reduce_vars: true,
side_effects: true,
@@ -1752,6 +1758,7 @@ redefine_arguments_2: {
redefine_arguments_3: {
options = {
evaluate: true,
+ inline: true,
keep_fargs: false,
passes: 3,
reduce_vars: true,
@@ -1828,6 +1835,7 @@ redefine_farg_1: {
redefine_farg_2: {
options = {
evaluate: true,
+ inline: true,
keep_fargs: false,
reduce_vars: true,
side_effects: true,
@@ -1864,6 +1872,7 @@ redefine_farg_2: {
redefine_farg_3: {
options = {
evaluate: true,
+ inline: true,
keep_fargs: false,
passes: 3,
reduce_vars: true,