Permalink
Browse files

fixed for visitors when node.init is a FunctionCall

  • Loading branch information...
duilio committed May 7, 2012
1 parent 71f4940 commit 3832095b90012488209a9d5097ade9c22937205e
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/slimit/visitors/ecmavisitor.py
  2. +2 −1 src/slimit/visitors/minvisitor.py
@@ -107,7 +107,7 @@ def visit_For(self, node):
s += self.visit(node.init)
if node.init is None:
s += ' ; '
- elif isinstance(node.init, (ast.Assign, ast.Comma)):
+ elif isinstance(node.init, (ast.Assign, ast.Comma, ast.FunctionCall)):
s += '; '
else:
s += ' '
@@ -140,7 +140,8 @@ def visit_For(self, node):
s += self.visit(node.init)
if node.init is None:
s += ';'
- elif isinstance(node.init, (ast.Assign, ast.Comma, ast.Conditional)):
+ elif isinstance(node.init, (ast.Assign, ast.Comma, ast.Conditional,
+ ast.FunctionCall)):
s += ';'
else:
s += ''

0 comments on commit 3832095

Please sign in to comment.