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

@@ -284,6 +284,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
}
node.thedef = sym;
node.reference(options);
if (node.scope.is_block_scope()
&& !(sym.orig[0] instanceof AST_SymbolBlockDeclaration)) {
node.scope = node.scope.get_defun_scope();
}
return true;
}
// ensure mangling works if catch reuses a scope variable