fix reduce_vars with uninitialized let variables (#2760)

fixes #2757
This commit is contained in:
Alex Lam S.L
2018-01-10 18:40:54 +08:00
committed by GitHub
parent 137cb73d1f
commit 1eb15f46f1
2 changed files with 58 additions and 1 deletions

View File

@@ -202,7 +202,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
|| node instanceof AST_SymbolConst) {
var def;
if (node instanceof AST_SymbolBlockDeclaration) {
def = scope.def_variable(node);
def = scope.def_variable(node, null);
} else {
def = defun.def_variable(node, node.TYPE == "SymbolVar" ? null : undefined);
}