From 9b6bc67c3393507d0621eb3debbe8845b0eff52d Mon Sep 17 00:00:00 2001 From: "Alex Lam S.L" Date: Tue, 4 Apr 2017 23:48:22 +0800 Subject: optimise `do{...}while(false)` (#1785) - better heuristics to avoid issues like #1532 - fix `TreeWalker.loopcontrol_target()` - `continue` cannot refer to `switch` blocks --- test/compress/loops.js | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/compress/loops.js b/test/compress/loops.js index c8d77840..f13f5cc5 100644 --- a/test/compress/loops.js +++ b/test/compress/loops.js @@ -215,8 +215,7 @@ evaluate: { a(); for(;;) c(); - // rule disabled due to issue_1532 - do d(); while (false); + d(); } } @@ -458,3 +457,26 @@ issue_1648: { } expect_exact: "function f(){for(x();1;);}" } + +do_switch: { + options = { + evaluate: true, + loops: true, + } + input: { + do { + switch (a) { + case b: + continue; + } + } while (false); + } + expect: { + do { + switch (a) { + case b: + continue; + } + } while (false); + } +} -- cgit v1.2.3