aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2021-07-05 04:57:58 +0100
committerGitHub <noreply@github.com>2021-07-05 11:57:58 +0800
commit6961c57d1e2849b4c7c9e43295015d0bee44daa5 (patch)
treeaf7adfaa209a5d1d3052bfe1484af7ae28e9ac57 /test
parentf5dbb672b90b0591a824935c4855afc99adc2e59 (diff)
downloadtracifyjs-6961c57d1e2849b4c7c9e43295015d0bee44daa5.tar.gz
tracifyjs-6961c57d1e2849b4c7c9e43295015d0bee44daa5.zip
fix corner case in `reduce_vars` (#5051)
fixes #5050
Diffstat (limited to 'test')
-rw-r--r--test/compress/reduce_vars.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js
index 735688ea..4af4945f 100644
--- a/test/compress/reduce_vars.js
+++ b/test/compress/reduce_vars.js
@@ -7696,3 +7696,32 @@ issue_5048: {
}
expect_stdout: "undefined"
}
+
+issue_5050: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ function f() {
+ console.log(a);
+ }
+ this;
+ var a = 1;
+ f(console.log(2), f(), a = 3);
+ }
+ expect: {
+ function f() {
+ console.log(a);
+ }
+ this;
+ var a = 1;
+ f(console.log(2), f(), a = 3);
+ }
+ expect_stdout: [
+ "2",
+ "1",
+ "3",
+ ]
+}