diff options
author | Alex Lam S.L <alexlamsl@gmail.com> | 2020-11-18 00:54:58 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-18 08:54:58 +0800 |
commit | aff842f2f9311295877de7e22c3c6afa4f82214b (patch) | |
tree | 55793b02a14e25c760928c86bf85d37b4d403785 /lib/scope.js | |
parent | 0bedd031da4fa8f0eef0fbe6737aa3a4c156a61e (diff) | |
download | tracifyjs-aff842f2f9311295877de7e22c3c6afa4f82214b.tar.gz tracifyjs-aff842f2f9311295877de7e22c3c6afa4f82214b.zip |
fix corner case in `arguments` (#4293)
fixes #4291
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/scope.js b/lib/scope.js index bffd493d..0e44280f 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -235,7 +235,11 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options) { if (!sym) { sym = self.def_global(node); } else if (name == "arguments" && sym.scope instanceof AST_Lambda) { - sym.scope.uses_arguments = true; + if (!(tw.parent() instanceof AST_PropAccess)) { + sym.scope.uses_arguments = "d"; + } else if (!sym.scope.uses_arguments) { + sym.scope.uses_arguments = true; + } } if (name == "eval") { var parent = tw.parent(); |