aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2019-11-04 13:13:48 +0800
committerGitHub <noreply@github.com>2019-11-04 13:13:48 +0800
commit0e29ad5eb9d6267c32f8ffb327aa79478c15e69c (patch)
tree2424d4dadde6286702b9a6caec4999f1b463c8d0 /test
parent0f2687ecfc6cdd3801f7726deec1c8cd4240a0da (diff)
downloadtracifyjs-0e29ad5eb9d6267c32f8ffb327aa79478c15e69c.tar.gz
tracifyjs-0e29ad5eb9d6267c32f8ffb327aa79478c15e69c.zip
fix corner case in `evaluate` (#3569)
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 98d0b8d6..74cb65ff 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -1876,3 +1876,27 @@ issue_3558: {
}
expect_stdout: "1 0"
}
+
+issue_3568: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ unsafe: true,
+ }
+ input: {
+ var a = 0;
+ function f(b) {
+ return b && b.p;
+ }
+ console.log(f(++a + f()));
+ }
+ expect: {
+ var a = 0;
+ function f(b) {
+ return b && b.p;
+ }
+ console.log(NaN);
+ }
+ expect_stdout: "NaN"
+}