relax collapse_vars on AST_Exit (#2855)

First introduced in #1862 to stop assignments to migrate beyond `return` or `throw`. Since then `collapse_vars` has been improved to handle various side-effect-related corner cases.
This commit is contained in:
Alex Lam S.L
2018-01-31 23:49:59 +08:00
committed by GitHub
parent 541e6011af
commit 2a4c68be4f
2 changed files with 83 additions and 1 deletions

View File

@@ -1044,7 +1044,6 @@ merge(Compressor.prototype, {
// but are otherwise not safe to scan into or beyond them.
var sym;
if (node instanceof AST_Call
|| node instanceof AST_Exit
|| node instanceof AST_PropAccess
&& (side_effects || node.expression.may_throw_on_access(compressor))
|| node instanceof AST_SymbolRef