diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2021-01-07 08:53:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-07 16:53:14 +0800 |
commit | 25321df959eb7aac7bd144be428a0aea0d29a0b9 (patch) | |
tree | 6c7bcf30e9705d1930c8f7d6a76c743122a1ef69 /test | |
parent | cf1b0165af4a181e8af6365eddbb144ce0d45da3 (diff) | |
download | tracifyjs-25321df959eb7aac7bd144be428a0aea0d29a0b9.tar.gz tracifyjs-25321df959eb7aac7bd144be428a0aea0d29a0b9.zip |
fix corner cases with `arguments` (#4520)
fixes #4519
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/destructured.js | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/test/compress/destructured.js b/test/compress/destructured.js index 4f6a9f2f..029b4427 100644 --- a/test/compress/destructured.js +++ b/test/compress/destructured.js @@ -2189,7 +2189,7 @@ issue_4446: { issue_4456: { options = { - pure_getters: true, + pure_getters: "strict", unused: true, } input: { @@ -2398,3 +2398,61 @@ issue_4512: { expect_stdout: "undefined" node_version: ">=6" } + +issue_4519_1: { + options = { + arguments: true, + keep_fargs: false, + } + input: { + try { + (function() { + var [ arguments ] = []; + arguments[0]; + })(); + } catch (e) { + console.log("PASS"); + } + } + expect: { + try { + (function() { + var [ arguments ] = []; + arguments[0]; + })(); + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=6" +} + +issue_4519_2: { + options = { + pure_getters: "strict", + side_effects: true, + } + input: { + try { + (function() { + var [ arguments ] = []; + arguments[0]; + })(); + } catch (e) { + console.log("PASS"); + } + } + expect: { + try { + (function() { + var [ arguments ] = []; + arguments[0]; + })(); + } catch (e) { + console.log("PASS"); + } + } + expect_stdout: "PASS" + node_version: ">=6" +} |