Skip to content

Commit

Permalink
finally address bug #40, this time with a regtest.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtaco committed Sep 19, 2012
1 parent c0bb9c1 commit 98d41b2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/coffee-script/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/nodes.coffee
Expand Up @@ -2731,7 +2731,7 @@ exports.For = class For extends While

# Handle the case of 'for i in [0..10]'
else if @range and @name
rop = if @range.exclusive then '<' else '<='
rop = if @source.base.exclusive then '<' else '<='
condition = new Op rop, @name, @source.base.to
init = [ new Assign @name, @source.base.from ]
if @step?
Expand Down
9 changes: 9 additions & 0 deletions test/iced.coffee
Expand Up @@ -638,4 +638,13 @@ atest 'more for + when (Issue #38 via @boris-petrov)', (cb) ->
await delay defer()
x = o.p
cb(x is 'b', {})

atest 'for + ...', (cb) ->
x = 0
inc = () ->
x++
for i in [0...10]
await delay defer(), 0
inc()
cb(x is 10, {})

0 comments on commit 98d41b2

Please sign in to comment.