diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2018-04-10 06:51:03 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-10 06:51:03 +0800 |
commit | b82fd0ad41983065ad6f58d9bfe4dac7720909bf (patch) | |
tree | 91c3cb2089fa2efbc6b1e38dd74d436058857e21 /test/compress | |
parent | 183da16896513c22b73d219affebeb155fb8ecdf (diff) | |
download | tracifyjs-b82fd0ad41983065ad6f58d9bfe4dac7720909bf.tar.gz tracifyjs-b82fd0ad41983065ad6f58d9bfe4dac7720909bf.zip |
handle flow control in loops with `reduce_vars` (#3069)
fixes #3068
Diffstat (limited to 'test/compress')
-rw-r--r-- | test/compress/reduce_vars.js | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/test/compress/reduce_vars.js b/test/compress/reduce_vars.js index 59a99b9c..63a17e72 100644 --- a/test/compress/reduce_vars.js +++ b/test/compress/reduce_vars.js @@ -5654,3 +5654,59 @@ issue_3042_2: { "true", ] } + +issue_3068_1: { + options = { + evaluate: true, + reduce_vars: true, + } + input: { + (function() { + do { + continue; + var b = "defined"; + } while (b && b.c); + })(); + } + expect: { + (function() { + do { + continue; + var b = "defined"; + } while (b && b.c); + })(); + } + expect_stdout: true +} + +issue_3068_2: { + options = { + evaluate: true, + reduce_vars: true, + } + input: { + (function() { + do { + try { + while ("" == typeof a); + } finally { + continue; + } + var b = "defined"; + } while (b && b.c); + })(); + } + expect: { + (function() { + do { + try { + while ("" == typeof a); + } finally { + continue; + } + var b = "defined"; + } while (b && b.c); + })(); + } + expect_stdout: true +} |