aboutsummaryrefslogtreecommitdiff
path: root/test/compress
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-05-10 23:33:52 +0100
committerGitHub <noreply@github.com>2020-05-11 06:33:52 +0800
commitc1dd49e07550c3c4599dab6570ff8291f5722b59 (patch)
tree5cfa182fec128c38a5208b47b18aec7106c10c1a /test/compress
parentc76ee4b868f2b2cdf87e7ab4a000997c475bdbf3 (diff)
downloadtracifyjs-c1dd49e07550c3c4599dab6570ff8291f5722b59.tar.gz
tracifyjs-c1dd49e07550c3c4599dab6570ff8291f5722b59.zip
fix corner case in `comparisons` (#3877)
Diffstat (limited to 'test/compress')
-rw-r--r--test/compress/comparisons.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/compress/comparisons.js b/test/compress/comparisons.js
index a4e0acc9..f93ccbe1 100644
--- a/test/compress/comparisons.js
+++ b/test/compress/comparisons.js
@@ -93,6 +93,36 @@ self_comparison_2: {
expect_stdout: "false true"
}
+self_comparison_3: {
+ options = {
+ comparisons: true,
+ }
+ input: {
+ var a;
+ function f() {
+ var b = a;
+ a = null;
+ return b;
+ }
+ for (var i = 0; i < 2; i++)
+ console.log(f() === f());
+ }
+ expect: {
+ var a;
+ function f() {
+ var b = a;
+ a = null;
+ return b;
+ }
+ for (var i = 0; i < 2; i++)
+ console.log(f() === f());
+ }
+ expect_stdout: [
+ "false",
+ "true",
+ ]
+}
+
issue_2857_1: {
options = {
comparisons: true,