diff options
Diffstat (limited to 'test/compress/collapse_vars.js')
-rw-r--r-- | test/compress/collapse_vars.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/compress/collapse_vars.js b/test/compress/collapse_vars.js index c915041f..bcc8b833 100644 --- a/test/compress/collapse_vars.js +++ b/test/compress/collapse_vars.js @@ -4931,6 +4931,27 @@ collapse_rhs_lhs_2: { expect_stdout: "PASS" } +collapse_rhs_loop: { + options = { + collapse_vars: true, + } + input: { + var s; + s = "<tpl>PASS</tpl>"; + for (var m, r = /<tpl>(.*)<\/tpl>/; m = s.match(r);) + s = s.replace(m[0], m[1]); + console.log(s); + } + expect: { + var s; + s = "<tpl>PASS</tpl>"; + for (var m, r = /<tpl>(.*)<\/tpl>/; m = s.match(r);) + s = s.replace(m[0], m[1]); + console.log(s); + } + expect_stdout: "PASS" +} + collapse_rhs_side_effects: { options = { collapse_vars: true, |