aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoralexlamsl <alexlamsl@gmail.com>2017-02-18 19:05:54 +0800
committeralexlamsl <alexlamsl@gmail.com>2017-02-21 13:29:57 +0800
commitae4db00991c6155fde42bd00c30614d922a4219a (patch)
tree685db4fa2dcb7e157c7a4afea5097c5236806bc5 /test
parent100307ab31e89075a5b0e56d47597a0525dd43a6 (diff)
downloadtracifyjs-ae4db00991c6155fde42bd00c30614d922a4219a.tar.gz
tracifyjs-ae4db00991c6155fde42bd00c30614d922a4219a.zip
tweak do-while loops
- `do{...}while(false)` => `{...}` - clean up `AST_While` logic closes #1452
Diffstat (limited to 'test')
-rw-r--r--test/compress/loops.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/compress/loops.js b/test/compress/loops.js
index 78f618aa..ca05461c 100644
--- a/test/compress/loops.js
+++ b/test/compress/loops.js
@@ -187,3 +187,32 @@ keep_collapse_const_in_own_block_scope_2: {
console.log(c);
}
}
+
+evaluate: {
+ options = {
+ loops: true,
+ dead_code: true,
+ evaluate: true,
+ };
+ input: {
+ while (true) {
+ a();
+ }
+ while (false) {
+ b();
+ }
+ do {
+ c();
+ } while (true);
+ do {
+ d();
+ } while (false);
+ }
+ expect: {
+ for(;;)
+ a();
+ for(;;)
+ c();
+ d();
+ }
+}