diff options
Diffstat (limited to 'test/compress/blocks.js')
-rw-r--r-- | test/compress/blocks.js | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/test/compress/blocks.js b/test/compress/blocks.js new file mode 100644 index 00000000..027b5d64 --- /dev/null +++ b/test/compress/blocks.js @@ -0,0 +1,49 @@ +remove_blocks: { + input: { + {;} + foo(); + {}; + { + {}; + }; + bar(); + {} + } + expect: { + foo(); + bar(); + } +} + +keep_some_blocks: { + input: { + // 1. + if (foo) { + {{{}}} + if (bar) baz(); + {{}} + } else { + stuff(); + } + + // 2. + if (foo) { + for (var i = 0; i < 5; ++i) + if (bar) baz(); + } else { + stuff(); + } + } + expect: { + // 1. + if (foo) { + if (bar) baz(); + } else stuff(); + + // 2. + if (foo) { + for (var i = 0; i < 5; ++i) + if (bar) baz(); + } else stuff(); + } +} |