diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-08-27 11:16:50 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-08-27 11:16:50 -0700 |
commit | 0e962d46df610c19f874a719adaa42cf6f517057 (patch) | |
tree | c7f9ee758c8e333b890a7ffe4babae1cb615aa59 /tools | |
parent | 711b304a00e6c8a939ec594b40291c54aaf71823 (diff) |
fix outlining separation of case statements ending in continue or return
Diffstat (limited to 'tools')
-rw-r--r-- | tools/js-optimizer.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/js-optimizer.js b/tools/js-optimizer.js index be17e1a3..f10d5308 100644 --- a/tools/js-optimizer.js +++ b/tools/js-optimizer.js @@ -135,6 +135,7 @@ var ASSIGN_OR_ALTER = set('assign', 'unary-postfix', 'unary-prefix'); var CONTROL_FLOW = set('do', 'while', 'for', 'if', 'switch'); var NAME_OR_NUM = set('name', 'num'); var ASSOCIATIVE_BINARIES = set('+', '*', '|', '&', '^'); +var ALTER_FLOW = set('break', 'continue', 'return'); var BREAK_CAPTURERS = set('do', 'while', 'for', 'switch'); var CONTINUE_CAPTURERS = LOOP; @@ -3073,7 +3074,7 @@ function outline(ast) { last = last[stats.length-1]; if (last && last[0] === 'block') last = last[1][last[1].length-1]; if (last && last[0] === 'stat') last = last[1]; - force = !last || last[0] !== 'break'; + force = !last || !(last[0] in ALTER_FLOW); } }); assert(currSize); |