diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-02-02 15:07:31 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 23:07:31 +0800 |
commit | 3c556b8689346f8256781455c0e1b2f00975570f (patch) | |
tree | 0083da4d3d5e4d574313764e17032940d91eef10 /test | |
parent | 7110c6923b8ef82f295f5d9ff9d42d2f88432810 (diff) | |
download | tracifyjs-3c556b8689346f8256781455c0e1b2f00975570f.tar.gz tracifyjs-3c556b8689346f8256781455c0e1b2f00975570f.zip |
fix corner case in `arguments` (#4609)
fixes #4608
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 58fec606..dd2daca9 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -2514,3 +2514,45 @@ issue_4584: { expect_stdout: "PASS" node_version: ">=6" } + +issue_4608_1: { + options = { + arguments: true, + keep_fargs: false, + } + input: { + (function() { + [ arguments ] = [ "foo" ]; + console.log(arguments[0]); + })(); + } + expect: { + (function() { + [ arguments ] = [ "foo" ]; + console.log(arguments[0]); + })(); + } + expect_stdout: "f" + node_version: ">=6" +} + +issue_4608_2: { + options = { + arguments: true, + reduce_vars: true, + } + input: { + (function(a) { + [ arguments ] = [ "foo" ]; + console.log(arguments[0]); + })(); + } + expect: { + (function(a) { + [ arguments ] = [ "foo" ]; + console.log(arguments[0]); + })(); + } + expect_stdout: "f" + node_version: ">=6" +} |