diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2017-06-15 03:28:26 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-15 03:28:26 +0800 |
commit | 3f961bbba04a8cec0ab74f4a13deb4be217da877 (patch) | |
tree | 11c594d0423b25fd14303bad7d87ad626085895e /lib/scope.js | |
parent | 0a1e523cd5de9b96946b05bd70b3f125a4bfb4cc (diff) | |
download | tracifyjs-3f961bbba04a8cec0ab74f4a13deb4be217da877.tar.gz tracifyjs-3f961bbba04a8cec0ab74f4a13deb4be217da877.zip |
compute `uses_arguments` correctly in `figure_out_scope()` (#2099)
fixes #2097
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/scope.js b/lib/scope.js index ea43f752..82a935a2 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -197,11 +197,10 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){ } } var sym = node.scope.find_variable(name); - if (node.scope instanceof AST_Lambda && name == "arguments") { - node.scope.uses_arguments = true; - } if (!sym) { sym = self.def_global(node); + } else if (sym.scope instanceof AST_Lambda && name == "arguments") { + sym.scope.uses_arguments = true; } node.thedef = sym; node.reference(options); |