aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2017-12-18 03:00:05 +0800
committerGitHub <noreply@github.com>2017-12-18 03:00:05 +0800
commitb29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79 (patch)
tree0852628060e5cfcf77ff223c6e2d0094f8a3b1ba /test
parent5de369fa67059efe694700513b66bf473fd98e06 (diff)
downloadtracifyjs-b29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79.tar.gz
tracifyjs-b29fc8b27c7bf4f48ff354ea2b9d55f7f4b69f79.zip
improve transversal efficiency in `collapse_vars` (#2611)
fixes #2603
Diffstat (limited to 'test')
-rw-r--r--test/compress/collapse_vars.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js
index 1a487981..9a20c559 100644
--- a/test/compress/collapse_vars.js
+++ b/test/compress/collapse_vars.js
@@ -3990,3 +3990,25 @@ cascade_call: {
}
}
}
+
+replace_all_var: {
+ options = {
+ collapse_vars: true,
+ unused: true,
+ }
+ input: {
+ var a = "PASS";
+ (function() {
+ var b = b || c && c[a = "FAIL"], c = a;
+ })();
+ console.log(a);
+ }
+ expect: {
+ var a = "PASS";
+ (function() {
+ var b = b || c && c[a = "FAIL"], c = a;
+ })();
+ console.log(a);
+ }
+ expect_stdout: "PASS"
+}