fix corner case with arguments as function name (#2729)

fixes #2728
This commit is contained in:
Alex Lam S.L
2018-01-05 22:21:18 +08:00
committed by GitHub
parent b82feb9302
commit 9f23185f2b
2 changed files with 124 additions and 1 deletions

View File

@@ -151,7 +151,7 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
node.references = [];
}
if (node instanceof AST_SymbolLambda) {
defun.def_function(node, defun);
defun.def_function(node, node.name == "arguments" ? undefined : defun);
}
else if (node instanceof AST_SymbolDefun) {
// Careful here, the scope where this should be defined is