handle variable declaration within catch blocks (#1546)

accounts for IE8- scoping
This commit is contained in:
Alex Lam S.L
2017-03-05 13:13:44 +08:00
committed by GitHub
parent b33e7f88e6
commit b70591be1a
5 changed files with 69 additions and 6 deletions

View File

@@ -154,8 +154,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
}
else if (node instanceof AST_SymbolVar
|| node instanceof AST_SymbolConst) {
var def = defun.def_variable(node);
def.init = tw.parent().value;
defun.def_variable(node);
}
else if (node instanceof AST_SymbolCatch) {
scope.def_variable(node);