aboutsummaryrefslogtreecommitdiff
path: root/lib/scope.js
diff options
context:
space:
mode:
authorAlex Lam S.L <alexlamsl@gmail.com>2020-10-19 01:32:39 +0100
committerGitHub <noreply@github.com>2020-10-19 08:32:39 +0800
commit96bf7fceabf1670ca07c08a04a3130e742775c8f (patch)
tree71a28df4db6ce0ec1a5e0423dad6b74ab00fa065 /lib/scope.js
parent6c7226c10ef1328c726ce7c5d364efed8ed0d374 (diff)
downloadtracifyjs-96bf7fceabf1670ca07c08a04a3130e742775c8f.tar.gz
tracifyjs-96bf7fceabf1670ca07c08a04a3130e742775c8f.zip
support `let` (#4227)
Diffstat (limited to 'lib/scope.js')
-rw-r--r--lib/scope.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/scope.js b/lib/scope.js
index ef19a530..4abf4066 100644
--- a/lib/scope.js
+++ b/lib/scope.js
@@ -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);