support let (#4227)

This commit is contained in:
Alex Lam S.L
2020-10-19 01:32:39 +01:00
committed by GitHub
parent 6c7226c10e
commit 96bf7fceab
10 changed files with 1186 additions and 152 deletions

View File

@@ -169,6 +169,8 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) {
} else if (node instanceof AST_SymbolLambda) {
var def = defun.def_function(node, node.name == "arguments" ? undefined : defun);
if (options.ie8) def.defun = defun.parent_scope.resolve();
} else if (node instanceof AST_SymbolLet) {
scope.def_variable(node);
} else if (node instanceof AST_SymbolVar) {
defun.def_variable(node, null);
entangle(defun, scope);