aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-12-29 11:43:12 +0000
committerGitHub <noreply@github.com>2020-12-29 19:43:12 +0800
commit560ccc1221639dca9db354ad6830e418a9f0073d (patch)
tree08ba152beaba140cc50a8bcc306bf1907f47e9c2 /test/compress
parent10a71c182bc4b992c91863fe0eb50a1afdae8a6f (diff)
downloadtracifyjs-560ccc1221639dca9db354ad6830e418a9f0073d.tar.gz
tracifyjs-560ccc1221639dca9db354ad6830e418a9f0073d.zip
enhance `reduce_vars` (#4479)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/let.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/let.js b/test/compress/let.js
index 59b89023..f52dcb50 100644
--- a/test/compress/let.js
+++ b/test/compress/let.js
@@ -359,6 +359,28 @@ reduce_block_2_toplevel: {
node_version: ">=4"
}
+reduce_vars: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ "use strict";
+ let a = "PASS";
+ console.log(a);
+ a = "FAIL";
+ }
+ expect: {
+ "use strict";
+ console.log("PASS");
+ "FAIL";
+ }
+ expect_stdout: "PASS"
+ node_version: ">=4"
+}
+
hoist_props: {
options = {
hoist_props: true,