aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-17 15:25:13 +0100
committerGitHub <noreply@github.com>2020-05-17 22:25:13 +0800
commit48b62393a4d947fe22d5516e53267a37245347c5 (patch)
tree01785e7ecc8f0e303762d674943152a729da7d5f /test
parenta00f8dade75838862d1d284440eea6d35198b63e (diff)
downloadtracifyjs-48b62393a4d947fe22d5516e53267a37245347c5.tar.gz
tracifyjs-48b62393a4d947fe22d5516e53267a37245347c5.zip
fix corner case in `evaluate` (#3904)
fixes #3903
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 8425abe2..3f9f1014 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -2418,3 +2418,29 @@ issue_3887: {
}
expect_stdout: "PASS"
}
+
+issue_3903: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unused: true,
+ }
+ input: {
+ var a = "PASS";
+ function f(b, c) {
+ return console, c;
+ }
+ var d = f(f(), a = a);
+ console.log(d);
+ }
+ expect: {
+ var a = "PASS";
+ function f(b, c) {
+ return console, c;
+ }
+ var d = f(f(), a = a);
+ console.log(d);
+ }
+ expect_stdout: "PASS"
+}