aboutsummaryrefslogtreecommitdiff
path: root/test/compress/evaluate.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-06-15 01:28:44 +0800
committerGitHub <noreply@github.com>2020-06-15 01:28:44 +0800
commitae9f56be109ccc27003868e997143823957f874d (patch)
tree9fc5f207cf85bb8d1a2480c37e51422f0fa5f835 /test/compress/evaluate.js
parent9aed0e3a734f4fd615ed539d8159e53be89af7e2 (diff)
downloadtracifyjs-ae9f56be109ccc27003868e997143823957f874d.tar.gz
tracifyjs-ae9f56be109ccc27003868e997143823957f874d.zip
fix corner case in `evaluate` (#3998)
fixes #3997
Diffstat (limited to 'test/compress/evaluate.js')
-rw-r--r--test/compress/evaluate.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js
index 4fecd701..dd94f613 100644
--- a/test/compress/evaluate.js
+++ b/test/compress/evaluate.js
@@ -2812,3 +2812,24 @@ operator_in: {
"true",
]
}
+
+issue_3997: {
+ options = {
+ evaluate: true,
+ reduce_vars: true,
+ toplevel: true,
+ }
+ input: {
+ var a = function f(b) {
+ return b[b += this] = b;
+ }(0);
+ console.log(typeof a);
+ }
+ expect: {
+ var a = function f(b) {
+ return b[b += this] = b;
+ }(0);
+ console.log(typeof a);
+ }
+ expect_stdout: "string"
+}