handle break & continue in collapse_vars (#2875)

fixes #2873
This commit is contained in:
Alex Lam S.L
2018-02-03 07:58:43 +08:00
committed by GitHub
parent e6a2e9e4d0
commit 7e13c0db40
2 changed files with 51 additions and 0 deletions

View File

@@ -968,6 +968,7 @@ merge(Compressor.prototype, {
|| node instanceof AST_Call && lhs instanceof AST_PropAccess && lhs.equivalent_to(node.expression)
|| node instanceof AST_Debugger
|| node instanceof AST_IterationStatement && !(node instanceof AST_For)
|| node instanceof AST_LoopControl
|| node instanceof AST_Try
|| node instanceof AST_With
|| parent instanceof AST_For && node !== parent.init