diff options
author | Jann Horn <jann@thejh.net> | 2016-10-14 18:04:39 +0200 |
---|---|---|
committer | Richard van Velzen <rvanvelzen1@gmail.com> | 2016-10-23 21:29:18 +0200 |
commit | 266ddd96399afcdee56d9d58b287f912b8728342 (patch) | |
tree | 2f56fa5946cf323707536a6e20154fa9ae4ac350 /lib/scope.js | |
parent | e51c6ba38014fc73a4804a69c556d96f777bc0b3 (diff) | |
download | tracifyjs-266ddd96399afcdee56d9d58b287f912b8728342.tar.gz tracifyjs-266ddd96399afcdee56d9d58b287f912b8728342.zip |
fix uses_arguments handling (broken since 6605d1578351)
Using the symbol declaration tracking of UglifyJS doesn't make sense here
anyway, `arguments` always comes from something in the current scope.
fixes #1299
Diffstat (limited to 'lib/scope.js')
-rw-r--r-- | lib/scope.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/scope.js b/lib/scope.js index fb583291..4943b568 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -204,6 +204,9 @@ 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) { var g; if (globals.has(name)) { @@ -215,9 +218,6 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){ globals.set(name, g); } sym = g; - if (func && name == "arguments") { - func.uses_arguments = true; - } } node.thedef = sym; if (parent instanceof AST_Unary && (parent.operator === '++' || parent.operator === '--') |