diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-07-12 16:16:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 23:16:12 +0800 |
commit | 92c3fddd7ae57a69de6f4e3448ae4a06b18f2fc6 (patch) | |
tree | 9ce34e74476eb2233aba17e71600c8d12989eec6 /test | |
parent | 0d350b78bfd7df22a6311efa94761e71950e3494 (diff) | |
download | tracifyjs-92c3fddd7ae57a69de6f4e3448ae4a06b18f2fc6.tar.gz tracifyjs-92c3fddd7ae57a69de6f4e3448ae4a06b18f2fc6.zip |
fix corner case in `unused` & `yields` (#5077)
fixes #5076
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/yields.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/yields.js b/test/compress/yields.js index 9df533b9..37fd30e3 100644 --- a/test/compress/yields.js +++ b/test/compress/yields.js @@ -1246,3 +1246,32 @@ issue_5034: { expect_stdout: "PASS" node_version: ">=4" } + +issue_5076: { + options = { + evaluate: true, + hoist_vars: true, + passes: 2, + pure_getters: "strict", + side_effects: true, + toplevel: true, + unused: true, + yields: true, + } + input: { + var a; + console.log("PASS"); + var b = function*({ + p: {}, + }) {}({ + p: { a } = 42, + }); + } + expect: { + var a; + console.log("PASS"); + a = 42["a"]; + } + expect_stdout: "PASS" + node_version: ">=6" +} |