diff options
Diffstat (limited to 'test/compress/evaluate.js')
-rw-r--r-- | test/compress/evaluate.js | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/compress/evaluate.js b/test/compress/evaluate.js index c1cb86cd..23785284 100644 --- a/test/compress/evaluate.js +++ b/test/compress/evaluate.js @@ -1610,3 +1610,47 @@ truthy_loops: { } } } + +if_increment: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + console.log(function(a) { + if (console) + return ++a; + }(0)); + } + expect: { + console.log(function(a) { + if (console) + return 1; + }()); + } + expect_stdout: "1" +} + +try_increment: { + options = { + evaluate: true, + reduce_vars: true, + unused: true, + } + input: { + console.log(function(a) { + try { + return ++a; + } catch (e) {} + }(0)); + } + expect: { + console.log(function(a) { + try { + return 1; + } catch (e) {} + }()); + } + expect_stdout: "1" +} |