fix export of keyword and redirection (#2143)

fixes #2141
fixes #2142
This commit is contained in:
Alex Lam S.L
2017-06-23 03:49:30 +08:00
committed by GitHub
parent 402954bdf3
commit b163b13a0b
3 changed files with 87 additions and 6 deletions

View File

@@ -263,8 +263,9 @@ AST_Toplevel.DEFMETHOD("figure_out_scope", function(options){
s.uses_eval = true;
}
}
var sym = node.scope.find_variable(name);
if (!sym) {
var sym;
if (tw.parent() instanceof AST_NameMapping && tw.parent(1).module_name
|| !(sym = node.scope.find_variable(name))) {
sym = self.def_global(node);
} else if (sym.scope instanceof AST_Lambda && name == "arguments") {
sym.scope.uses_arguments = true;