diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-05-30 05:00:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-30 12:00:32 +0800 |
commit | 23b9f36bd83e95c36a12059546098f10452b56ba (patch) | |
tree | 436e66b4fc032193cf676991b988208d24b45c6c /test/compress | |
parent | 7e88d52faeb7032f54e9526b85042f06098e71b9 (diff) | |
download | tracifyjs-23b9f36bd83e95c36a12059546098f10452b56ba.tar.gz tracifyjs-23b9f36bd83e95c36a12059546098f10452b56ba.zip |
fix corner case in `hoist_props` (#4986)
fixes #4985
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/let.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/compress/let.js b/test/compress/let.js index 4df5bb01..64526aa7 100644 --- a/test/compress/let.js +++ b/test/compress/let.js @@ -1580,3 +1580,27 @@ issue_4848: { expect_stdout: "PASS" node_version: ">=4" } + +issue_4985: { + options = { + hoist_props: true, + reduce_vars: true, + toplevel: true, + } + input: { + "use strict"; + let a = { p: 42 }; + console.log(function() { + a; + }()); + } + expect: { + "use strict"; + let a = { p: 42 }; + console.log(function() { + a; + }()); + } + expect_stdout: "undefined" + node_version: ">=4" +} |