diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-06-11 00:37:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-11 07:37:39 +0800 |
commit | e89031f1afda74264c4cd4153032c16ba8d86879 (patch) | |
tree | bc4cdef5b0df371d0d3794d21b98f5eccbb77a50 /test/compress/evaluate.js | |
parent | 596fad182e853f83960b6b659b8093aa8ad09fc6 (diff) | |
download | tracifyjs-e89031f1afda74264c4cd4153032c16ba8d86879.tar.gz tracifyjs-e89031f1afda74264c4cd4153032c16ba8d86879.zip |
fix corner case in `unsafe` `evaluate` (#3989)
fixes #3988
Diffstat (limited to 'test/compress/evaluate.js')
-rw-r--r-- | test/compress/evaluate.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index 0f3a9fd1..da928b3c 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -2735,3 +2735,27 @@ issue_3953: { } expect_stdout: "PASS" } + +issue_3988: { + options = { + evaluate: true, + reduce_vars: true, + toplevel: true, + unsafe: true, + unused: true, + } + input: { + function f(b) { + return ("" + (b &= 0))[b && this]; + } + var a = f(); + console.log(a); + } + expect: { + var a = function(b) { + return ("" + (b &= 0))[b && this]; + }(); + console.log(a); + } + expect_stdout: "0" +} |