Skip to content
Browse files

fixed for visitors when node.init is a FunctionCall

  • Loading branch information...
1 parent 71f4940 commit 3832095b90012488209a9d5097ade9c22937205e @duilio duilio committed
Showing with 3 additions and 2 deletions.
  1. +1 −1 src/slimit/visitors/ecmavisitor.py
  2. +2 −1 src/slimit/visitors/minvisitor.py
View
2 src/slimit/visitors/ecmavisitor.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 += ' '
View
3 src/slimit/visitors/minvisitor.py
@@ -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.
Something went wrong with that request. Please try again.