aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-08-24 07:57:26 +0100
committerGitHub <noreply@github.com>2020-08-24 14:57:26 +0800
commit0eb0c9b388a17fbadd9f74a15effe7477695d5e6 (patch)
tree8e6882a2ac25db8928c081b54a75306367121117 /test
parent7dc61cdc895d055edfa9b1d82d17688ad3a57f1c (diff)
downloadtracifyjs-0eb0c9b388a17fbadd9f74a15effe7477695d5e6.tar.gz
tracifyjs-0eb0c9b388a17fbadd9f74a15effe7477695d5e6.zip
fix corner case in `evaluate` (#4068)
fixes #4067
Diffstat (limited to 'test')
-rw-r--r--test/compress/evaluate.js25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index b5b74ac0..9f97ba99 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -2869,3 +2869,28 @@ issue_4035: {
"true",
]
}
+
+issue_4067: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ unsafe: true,
+ }
+ input: {
+ (function(a) {
+ (function(b) {
+ b[0] += 0;
+ console.log(+a);
+ })(a);
+ })([]);
+ }
+ expect: {
+ (function(a) {
+ (function(b) {
+ b[0] += 0;
+ console.log(+a);
+ })(a);
+ })([]);
+ }
+ expect_stdout: "NaN"
+}