diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2019-05-14 05:26:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-14 05:26:40 +0800 |
commit | d538a732501f6654ce359ae3ee44a55a873c6a7d (patch) | |
tree | fbced456c1b877855bac7df483e4b341e06bdaaa /test | |
parent | 2e4fbdeb08ea5a9b78285218fed8b968bdd32172 (diff) | |
download | tracifyjs-d538a732501f6654ce359ae3ee44a55a873c6a7d.tar.gz tracifyjs-d538a732501f6654ce359ae3ee44a55a873c6a7d.zip |
enhance `side_effects` (#3410)
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/loops.js | 16 | ||||
-rw-r--r-- | test/compress/pure_getters.js | 26 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js index 137fd9da..d835080d 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -673,3 +673,19 @@ issue_3371: { } expect_stdout: "PASS" } + +step: { + options = { + loops: true, + side_effects: true, + } + input: { + for (var i = 0; i < 42; "foo", i++, "bar"); + console.log(i); + } + expect: { + for (var i = 0; i < 42; i++); + console.log(i); + } + expect_stdout: "42" +} diff --git a/test/compress/pure_getters.js b/test/compress/pure_getters.js index 61ce8a92..b6e42f9d 100644 --- a/test/compress/pure_getters.js +++ b/test/compress/pure_getters.js @@ -1161,3 +1161,29 @@ collapse_rhs_lhs: { } expect_stdout: "1 3" } + +drop_arguments: { + options = { + pure_getters: "strict", + side_effects: true, + } + input: { + (function() { + arguments.slice = function() { + console.log("PASS"); + }; + arguments[42]; + arguments.length; + arguments.slice(); + })(); + } + expect: { + (function() { + arguments.slice = function() { + console.log("PASS"); + }; + arguments.slice(); + })(); + } + expect_stdout: "PASS" +} |