diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-06-16 14:54:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-16 14:54:46 +0800 |
commit | 11e63bc3351597a7cd05a769346bb577e65069d4 (patch) | |
tree | 02724a869226c6bb1aec1fa6d75f0cec7baa2d80 /test | |
parent | 33405bb24b9a5933badf146a9576953b8b456aad (diff) | |
download | tracifyjs-11e63bc3351597a7cd05a769346bb577e65069d4.tar.gz tracifyjs-11e63bc3351597a7cd05a769346bb577e65069d4.zip |
correctly determine scope of `AST_This` (#2109)
fixes #2107
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/functions.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/functions.js b/test/compress/functions.js index c2794f26..dc430d18 100644 --- a/test/compress/functions.js +++ b/test/compress/functions.js @@ -414,3 +414,32 @@ inner_ref: { } expect_stdout: "1 undefined" } + +issue_2107: { + options = { + cascade: true, + collapse_vars: true, + inline: true, + sequences: true, + side_effects: true, + unused: true, + } + input: { + var c = 0; + !function() { + c++; + }(c++ + new function() { + this.a = 0; + var a = (c = c + 1) + (c = 1 + c); + return c++ + a; + }()); + console.log(c); + } + expect: { + var c = 0; + c++, new function() { + this.a = 0, c = 1 + (c += 1), c++; + }(), c++, console.log(c); + } + expect_stdout: "5" +} |