diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-08-25 10:23:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 17:23:36 +0800 |
commit | a31c27c7cf0c1543305c7710b139201850132e15 (patch) | |
tree | c77ff4a46e422c664ca7a348576190cc1e5204b0 /test/compress/collapse_vars.js | |
parent | 1caf7c7bd2160a5f249066bf62292f3589ceebb1 (diff) | |
download | tracifyjs-a31c27c7cf0c1543305c7710b139201850132e15.tar.gz tracifyjs-a31c27c7cf0c1543305c7710b139201850132e15.zip |
fix corner case in `collapse_vars` (#4071)
fixes #4070
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index c042f969..709fc6b7 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -8538,3 +8538,25 @@ issue_4051: { } expect_stdout: "undefined" } + +issue_4070: { + options = { + collapse_vars: true, + pure_getters: "strict", + reduce_vars: true, + } + input: { + console.log(function f() { + function g() {} + g.p++; + return f.p = g.p; + }()); + } + expect: { + console.log(function f() { + function g() {} + return f.p = ++g.p; + }()); + } + expect_stdout: "NaN" +} |