Fix optimization in JS BE

Don't apply while condition folding when corresponding break
statement breaks outer loop.
This commit is contained in:
Alexey Andreev
2017-04-27 17:32:27 +03:00
parent d89ce80d97
commit 6047746c90
4 changed files with 41 additions and 1 deletions
@@ -105,7 +105,7 @@ class WhileConditionFolding(val body: JsBlock) {
// therefore for single `break` we should return `false`.
is JsBreak -> {
val target = statement.label?.name
if (label == null || label == target) JsLiteral.FALSE else null
if (label == target) JsLiteral.FALSE else null
}
// Code like this