diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-06-23 04:44:57 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-23 04:44:57 +0800 |
commit | 3d5bc081851897648ccc71009a2138240fe41fa0 (patch) | |
tree | d8d3a51a3adf82d58d25e45ac49afe02ae1548b1 /test/compress | |
parent | 0692435f01aad54fb586d24ad0c118d70b5c26ee (diff) | |
download | tracifyjs-3d5bc081851897648ccc71009a2138240fe41fa0.tar.gz tracifyjs-3d5bc081851897648ccc71009a2138240fe41fa0.zip |
fix `reduce_vars` on `this` (#2145)
fixes #2140
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/reduce_vars.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index cef29832..5906a971 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -2575,3 +2575,28 @@ accessor: { } expect_stdout: "1 1" } + +for_in_prop: { + options = { + reduce_vars: true, + } + input: { + var a = { + foo: function() { + for (this.b in [1, 2]); + } + }; + a.foo(); + console.log(a.b); + } + expect: { + var a = { + foo: function() { + for (this.b in [1, 2]); + } + }; + a.foo(); + console.log(a.b); + } + expect_stdout: "1" +} |