fix corner case in reduce_vars (#3632)

fixes #3631
This commit is contained in:
Alex Lam S.L
2019-12-10 09:45:51 +00:00
committed by GitHub
parent fe19ab7c57
commit 18c2b1841b
2 changed files with 48 additions and 2 deletions

View File

@@ -648,7 +648,7 @@ merge(Compressor.prototype, {
tw.in_loop = this;
push(tw);
this.body.walk(tw);
if (has_break_or_continue(this)) {
if (has_break_or_continue(this, tw.parent())) {
pop(tw);
push(tw);
}
@@ -665,7 +665,7 @@ merge(Compressor.prototype, {
if (this.condition) this.condition.walk(tw);
this.body.walk(tw);
if (this.step) {
if (has_break_or_continue(this)) {
if (has_break_or_continue(this, tw.parent())) {
pop(tw);
push(tw);
}