diff options
author | Mihai Bazon <mihai@bazon.net> | 2012-11-14 12:21:43 +0200 |
---|---|---|
committer | Mihai Bazon <mihai@bazon.net> | 2012-11-14 12:21:43 +0200 |
commit | bdfcbf496b1b7be16dfd8a55c72bad8e5a33cf82 (patch) | |
tree | aacb35f73e4c551d77d0ff6765cff0c37980e3a0 /test | |
parent | dba8da48005956e151a097e85896b161b4224782 (diff) | |
download | tracifyjs-bdfcbf496b1b7be16dfd8a55c72bad8e5a33cf82.tar.gz tracifyjs-bdfcbf496b1b7be16dfd8a55c72bad8e5a33cf82.zip |
better solution for the last test in constant switch folding
Diffstat (limited to 'test')
-rw-r--r-- | test/compress/switch.js | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/test/compress/switch.js b/test/compress/switch.js index 7c1e021c..6fde5dd3 100644 --- a/test/compress/switch.js +++ b/test/compress/switch.js @@ -176,11 +176,35 @@ constant_switch_8: { } } expect: { + OUT: { + x(); + for (;;) break OUT; + y(); + } + } +} + +constant_switch_9: { + options = { dead_code: true, evaluate: true }; + input: { OUT: switch (1) { case 1: x(); - for (;;) break OUT; + for (;;) if (foo) break OUT; y(); + case 1+1: + bar(); + default: + def(); + } + } + expect: { + OUT: { + x(); + for (;;) if (foo) break OUT; + y(); + bar(); + def(); } } } |