Permalink
Browse files

Fix issue #37, handle simple identifier in FOR init

  • Loading branch information...
1 parent f9b8b22 commit 220eec817c3b4c275a0d2addb6d2fd7672e7c9a7 Lele Gaifax committed Oct 3, 2012
Showing with 16 additions and 1 deletion.
  1. +3 −0 CHANGES
  2. +12 −0 src/slimit/tests/test_parser.py
  3. +1 −1 src/slimit/visitors/ecmavisitor.py
View
@@ -1,5 +1,8 @@
Change History
==============
+0.7.x (unreleased)
+- Bug fix (simple identifier in FOR init): https://github.com/rspivak/slimit/issues/37
+
0.7.4 (2012-06-5)
------------------
- Bug fix: https://github.com/rspivak/slimit/issues/34
@@ -195,6 +195,18 @@ class ASITestCase(unittest.TestCase):
}
"""),
+
+ ("""
+ var i;
+ for (i; i < length; i++) {
+ }
+ """,
+ """
+ var i;
+ for (i; i < length; i++) {
+
+ }
+ """),
]
def test_throw_statement(self):
@@ -138,7 +138,7 @@ def visit_For(self, node):
if node.init is None:
s += ' ; '
elif isinstance(node.init, (ast.Assign, ast.Comma, ast.FunctionCall,
- ast.UnaryOp)):
+ ast.UnaryOp, ast.Identifier)):
s += '; '
else:
s += ' '

0 comments on commit 220eec8

Please sign in to comment.