mark AST_Var out of block scopes (#2700)

This commit is contained in:
Alex Lam S.L
2018-01-02 01:37:59 +08:00
committed by GitHub
parent a6653e2102
commit ffc64e2279
3 changed files with 11 additions and 17 deletions

View File

@@ -5032,10 +5032,8 @@ merge(Compressor.prototype, {
var init;
if (fixed instanceof AST_This) {
if (!(d.orig[0] instanceof AST_SymbolFunarg)
&& all(d.references, d.scope.is_block_scope() ? function(ref) {
&& all(d.references, function(ref) {
return d.scope === ref.scope;
} : function(ref) {
return d.scope === ref.scope.get_defun_scope();
})) {
init = fixed;
}