aboutsummaryrefslogtreecommitdiff
path: root/test/compress/reduce_vars.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-11-06 14:25:10 +0800
committerGitHub <noreply@github.com>2017-11-06 14:25:10 +0800
commit6c4510187066555c77003f03fd26e2cf5ff47491 (patch)
tree6539b4a00e243ed46b60c6b0387a1ec987a291e0 /test/compress/reduce_vars.js
parent2c2fd89e343626f8d7dc83812a6476b0ab99b784 (diff)
downloadtracifyjs-6c4510187066555c77003f03fd26e2cf5ff47491.tar.gz
tracifyjs-6c4510187066555c77003f03fd26e2cf5ff47491.zip
consolidate & enhance `unused` (#2439)
- defer declaration removal in `collapse_vars` - account for `AST_SymbolFunarg` in deduplication - private accounting for `collapse_vars` - avoid issues with identity reference due to deep cloning fixes #2437
Diffstat (limited to 'test/compress/reduce_vars.js')
-rw-r--r--test/compress/reduce_vars.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 7714ad5d..1acd902b 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -2131,14 +2131,13 @@ redefine_farg_1: {
}
expect: {
function f(a) {
- var a;
return typeof a;
}
function g() {
- return"number";
+ return "number";
}
function h(a, b) {
- var a = b;
+ a = b;
return typeof a;
}
console.log(f([]), g([]), h([]));
@@ -2173,10 +2172,9 @@ redefine_farg_2: {
}
expect: {
console.log(function(a) {
- var a;
return typeof a;
}([]), "number",function(a, b) {
- var a = b;
+ a = b;
return typeof a;
}([]));
}
@@ -2185,11 +2183,13 @@ redefine_farg_2: {
redefine_farg_3: {
options = {
+ cascade: true,
evaluate: true,
inline: true,
keep_fargs: false,
- passes: 3,
+ passes: 2,
reduce_vars: true,
+ sequences: true,
side_effects: true,
toplevel: true,
unused: true,