Permalink
Browse files

fix test "tests/functions/and.py" and others that were failing becaus…

…e visit_AssignSimple added "var " to module references
  • Loading branch information...
1 parent b164451 commit 126b10aa4f7ccbb28c661af8509f9a2640cdf2d5 @thenewguy committed Jul 14, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 pyjaco/compiler/python.py
@@ -293,7 +293,8 @@ def visit_AssignSimple(self, target, value):
if isinstance(target, ast.Name):
if not var in self._global_identifiers and not var in self._vars:
self._vars.append(var)
- declare = "var "
+ if not self.module or not var.startswith(self.module_ref):
+ declare = "var "
js.append("%s%s = %s.PY$__getitem__(%d);" % (declare, var, dummy, i))
elif isinstance(target, ast.Subscript) and isinstance(target.slice, ast.Index):
# found index assignment

0 comments on commit 126b10a

Please sign in to comment.