Skip to content

Commit

Permalink
fix #284
Browse files Browse the repository at this point in the history
  • Loading branch information
timaschew committed Aug 23, 2014
1 parent 571f503 commit 1d2f6dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/documents/lib/js2coffee.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ class Builder

c.add "for #{@build n.iterator} of #{@build n.object}"
#c.scope @body(n.body)
if n.body.children.length > 0
if n.body.children.length > 0 or n.body.expression?
c.scope @body(n.body)
else
c.scope "continue"
Expand Down
4 changes: 3 additions & 1 deletion src/documents/test/features/for_in.coffee
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
for x of y
alert 1
for key of obj
continue
continue
for key of obj
single_liner()
4 changes: 3 additions & 1 deletion src/documents/test/features/for_in.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
for (x in y) { alert(1) }
for (key in obj) {}
for (key in obj) {}
for (key in obj)
single_liner()

0 comments on commit 1d2f6dd

Please sign in to comment.