diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-18 03:39:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 11:39:32 +0800 |
commit | 35283e5dd18bb2b3be46a25786e2e73e8a24a863 (patch) | |
tree | 0a35ecfeb7393416bf86bc9b215628cdc11659df /test/compress | |
parent | 7a51c17ff0005ca3725c8afefe2f4086f4316ee2 (diff) | |
download | tracifyjs-35283e5dd18bb2b3be46a25786e2e73e8a24a863.tar.gz tracifyjs-35283e5dd18bb2b3be46a25786e2e73e8a24a863.zip |
enhance `arguments` (#4296)
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/arguments.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/compress/arguments.js b/test/compress/arguments.js index 37307ed5..4b09a99a 100644 --- a/test/compress/arguments.js +++ b/test/compress/arguments.js @@ -808,7 +808,7 @@ issue_4200: { expect_stdout: "undefined" } -issue_4291: { +issue_4291_1: { options = { arguments: true, keep_fargs: "strict", @@ -827,3 +827,27 @@ issue_4291: { } expect_stdout: "PASS" } + +issue_4291_2: { + options = { + arguments: true, + keep_fargs: "strict", + } + input: { + var a = function() { + if (arguments[0]) + arguments[1] = "PASS"; + return arguments; + }(42); + console.log(a[1], a[0], a.length); + } + expect: { + var a = function(argument_0) { + if (argument_0) + arguments[1] = "PASS"; + return arguments; + }(42); + console.log(a[1], a[0], a.length); + } + expect_stdout: "PASS 42 1" +} |